title: JavaScript Adding Method Conditionally
body: <p>I am reading "JavaScript: The Good Parts" and have come across this confusing code snip-it</p>
  
  <pre><code> Function.prototype.method = function( name, func){
      if (!this.prototype[name]){
          this.prototype[name] = func;
      }
  };
  </code></pre>
  
  <p>The book says "One defensive technique is to add a method only if the method is known to be missing." The question i have regarding this are:</p>
  
  <ul>
  <li>how does this code snip-it work?</li>
  <li>how would i use this method we created</li>
  <li>why is it "this.prototype" and not "this.method" or "this.name" </li>
  </ul>
  
  <p>Thank you for your time</p>