title: javascript what is Object vs Object.prototype when used in Object.create's proto parameter
body: <p>I am trying to understand the difference between Object and Object.prototype. Because to create an empty object Object.prototype is used. I felt why not Object.</p>
  
  <p>I am creating an object in the following ways.</p>
  
  <p>Method 1:</p>
  
  <pre><code>o = Object.create(Object.prototype,{ p : {value: "test"} });
  console.log(o.__proto__);
  </code></pre>
  
  <p>result is:</p>
  
  <pre><code>Object {__defineGetter__: function, __defineSetter__: function, hasOwnProperty: function, __lookupGetter__: function, __lookupSetter__: function…}
  </code></pre>
  
  <p>and</p>
  
  <pre><code>console.log(o)
  </code></pre>
  
  <p>result is</p>
  
  <pre><code>Object {p: "test"}
      p : "test"
      __proto__ : Object
          constructor : function Object()
          hasOwnProperty : function hasOwnProperty()
          isPrototypeOf : function isPrototypeOf()
          propertyIsEnumerable : function propertyIsEnumerable()
          toLocaleString : function toLocaleString()
          toString : function toString()
          valueOf : function valueOf()
          __defineGetter__ : function __defineGetter__()
          __defineSetter__ : function __defineSetter__()
          __lookupGetter__ : function __lookupGetter__()
          __lookupSetter__ : function __lookupSetter__()
          get __proto__ : function __proto__()
          set __proto__ : function __proto__()
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>o = Object.create(Object,{ p : {value: "test"} });
  console.log(o.__proto__);
  </code></pre>
  
  <p>result is:</p>
  
  <pre><code>function Object() { [native code] }
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>console.log(o)
  </code></pre>
  
  <p>result is:</p>
  
  <pre><code>Function {p: "test"}
      p : "test"
      __proto__ : function Object()
          arguments : null
          assign : function assign()
          caller : null
          create : function create()
          defineProperties : function defineProperties()
          defineProperty : function defineProperty()
          entries : function entries()
          freeze : function freeze()
          getOwnPropertyDescriptor : function getOwnPropertyDescriptor()
          getOwnPropertyDescriptors : function getOwnPropertyDescriptors()
          getOwnPropertyNames : function getOwnPropertyNames()
          getOwnPropertySymbols : function getOwnPropertySymbols()
          getPrototypeOf : function getPrototypeOf()
          is : function is()
          isExtensible : function isExtensible()
          isFrozen : function isFrozen()
          isSealed : function isSealed()
          keys : function keys()
          length : 1
          name : "Object"
          preventExtensions : function preventExtensions()
          prototype : Object
          seal : function seal()
          setPrototypeOf : function setPrototypeOf()
          values : function values()
          __proto__ : function ()
          [[FunctionLocation]] : &lt;unknown&gt;
  </code></pre>
  
  <p>In general i found that:</p>
  
  <pre><code>o = {};
  // is equivalent to:
  o = Object.create(Object.prototype);
  </code></pre>
  
  <p>why not</p>
  
  <pre><code>o = {};
  // is equivalent to:
  o = Object.create(Object);
  </code></pre>