title: Javascript prototypes methods vs. internal methods
body: <p>What is the difference between making a method using <code>prototype</code> and just creating it inside a function? E.g., what's the difference between <code>methodOne</code> and <code>methodTwo</code> below?</p>
  
  <pre><code>function myFunc() {
    this.methodOne = function () { console.log("First method.")};
  }
  
  myFunc.prototype.methodTwo = function () { console.log("Second method.")};
  </code></pre>
  
  <p>They seem to behave the same way:</p>
  
  <pre><code>var myFuncInstance = new myFunc();
  myFuncInstance.methodOne();
  myFuncInstance.methodTwo();
  </code></pre>
  
  <p>But my sense is that <code>methodTwo</code>, by accessing the <code>prototype</code> directly, is doing something a little different. </p>