What is the purpose of this JS pattern?
<p>I am looking through someone else's code and I see this pattern being applied:</p>

<pre>var MyObj = function(){

 this._myHiMember = this.assignHi();

};

</pre>

<p>And then, pretty much in the next line, this bit of code:</p>

<pre>
 MyObj.prototype = {
   assignHi : function(){ return 'hi, ppl';}
};
</pre>

<p>My question is, why not do this instead:</p>

<pre>

var MyObj = function(){

 this.assignHi = function(){ return 'hi, ppl';}
 this._myHiMember = this.assignHi();

};

</pre>

<p>What is the purpose of creating that inline object and assigning it to MyObj's prototype? I hope I'm not missing something obvious.</p>
