title: JavaScript OOP: method definition with or without "prototype"
body: <p>Is this code,</p>
  
  <pre><code>function Person() {
      function  myMethod() {
          alert ('hello');
      }
      this.method = myMethod;
  }
  </code></pre>
  
  <p>equivalent to:</p>
  
  <pre><code>function Person() {    }
  Person.prototype.method2  = function() {
      alert ('hello');
  };
  </code></pre>
  
  <p>If yes, which method definition should I use and why?</p>