title: Beget function in JavaScript: The Good Parts
body: <p>I am reading JavaScript: The Good Parts. In the book, a beget function is defined. Its purpose is to create and return a new object, which uses the other object as its prototype. Why does the beget function instantiate a new function instead of an object?</p>
  
  <pre><code>if( typeof Object.beget !== 'function' ){
      Object.beget = function(o){
            var F =new Function(){}; // this line, why it cannot be var F = new Object();
            F.prototype = o;
            return new F();
      }
  }
  </code></pre>