Tell me more ×  I have been re-factoring someone else's
JavaScript code.   function SomeObj(flag) {     var _private =
true;     this.flag = (flag) ? true : false;
this.version="1.1 (prototype)";     if (!this._someProperty)
this._init();             // leading underscore hints at what
should be a 'private' to me     this.reset(); // assumes reset
has been added...  SomeObj.prototype.reset = function() {     /*
perform some actions */  /* UPDATE */
SomeObj.prototype.getPrivate = function() {     return _private;
// will return undefined  /* ...several other functions appended
via `prototype`...*/   var SomeObj = function (flag) {     var
_private = true;     this.flag = (flag) ? true : false;
this.version = "2.0 (constructor)";      this.reset = function
() {        /* perform some actions */      /* UPDATE */
this.getPrivate = function() {         return _private; // will
return true      /* other functions and function calls here */
For me the first example looks difficult to read, especially i