title: It is said that all Javascript objects have a prototype property, but I only see foo.prototype if foo is a function?
body: <p>It is often said that every Javascript object has a <code>prototype</code> property, but I find that <code>foo.prototype</code> has a value only if <code>foo</code> is a function.</p>
  
  <p>On Chrome and Firefox, <code>obj.__proto__</code> has a value -- is this the said <code>prototype</code> property?  But on IE 9,  it won't work (is there some way that can?), and I thought by <code>prototype</code> property, that means <code>obj.prototype</code> should work?</p>
  
  <p>I understand that <code>Object.getPrototypeOf(obj)</code> seems to show this <code>prototype</code> property, but why need a special method to get it?  Why not just like <code>person.name</code>, which is to get the <code>name</code> property of the <code>person</code> object?</p>
  
  <hr>
  
  <p><strong>Update:</strong> by the way, <code>obj.constructor.prototype</code> seems to <strong>sometimes</strong> be that prototype, but sometimes not, as in the following code done with Prototypal inheritance with no constructor: (this method is in the Pro Javascript Design Patterns book by Harmes and Diaz by Apress 2008, p. 46)</p>
  
  <pre><code>var Person = {
      name: 'default value',
      getName: function() {
          return this.name;
      }
  }
  
  var reader = clone(Person);
  console.log(reader.getName());
  reader.name = "Ang Lee";
  console.log(reader.getName());
  
  function clone(obj) {
      function F() {};
      F.prototype = obj;
      return new F;
  }
  
  console.log("the prototype of reader is", Object.getPrototypeOf(reader));
  
  console.log(Object.getPrototypeOf(reader) === reader.constructor.prototype);
  console.log(Object.getPrototypeOf(reader) == reader.constructor.prototype);
  
  console.log(Object.getPrototypeOf(reader) === reader.__proto__);
  console.log(Object.getPrototypeOf(reader) == reader.__proto__);
  </code></pre>
  
  <p>the result will show false, false, true, true for the last 4 lines.</p>