title: JavaScript: Function.prototype
body: <p>Below is some code copied from "good parts", with some modification.</p>
  
  <p>program.html</p>
  
  <pre><code>&lt;html&gt;&lt;body&gt;&lt;pre&gt;&lt;script src="program.js"&gt;
  &lt;/script&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>program.js</p>
  
  <pre><code>Function.prototype.method = function (name, func) {
      this.prototype[name] = func;
      return this;
  };
  
  var Quo_2 = function (string) {
      this.status = string;
  };
  
  Quo_2.method(get_status, function () { return this.status; });
  
  var myQuo_2 = new Quo_2("confused 2");
  
  document.writeln(myQuo_2.get_status());
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>ReferenceError: get_status is not defined
  </code></pre>