title: Null prototype, Object.prototype and Object.create
body: <p>Why is it that setting the prototype property of a constructor function to <code>null</code> does not prevent objects created from that function from calling through to methods on <code>Object.prototype</code>, in the same way that setting the prototype to <code>Object.create(null)</code> does?</p>
  
  <p>That is, why is this the case:</p>
  
  <pre><code>function Foo(){}
  Foo.prototype = null;
  console.log(new Foo().toString); //outputs function toString() { [native code] } (or whatever)
  
  function Foo(){}
  Foo.prototype = Object.create(null);
  console.log(new Foo().toString); //output undefined
  </code></pre>