JavaScript: Object.prototype

By Xah Lee. Date: . Last updated: .

Object.prototype is the value of the property key "prototype" of the Object object.

〔➤see JavaScript: Object Object

console.log( Object.hasOwnProperty ( "prototype" ) ); // true

Type of Object.prototype is object. That is, same type as {}.

〔➤see JavaScript: Data Types

// type of Object.prototype
console.log ( typeof Object.prototype === "object" ); // true
console.log ( Object.prototype ) === "[object Object]" ) // true

Object.prototype is the root parent of all standard objects.

Parent of Object.prototype is null.

// parent of Object.prototype
console.log ( Object.getPrototypeOf ( Object.prototype ) === null ); // true

〔➤see JavaScript: Prototype and Inheritance

All standard objects inherit from Object.prototype. So, for any property key k of Object.prototype, you can access it by obj.k where obj is any object. If the object obj has k as its own property, the own property is used.




Value is the function object Object.

console.log(Object.prototype.constructor === Object); // true
console.log({}.constructor === Object); // true

〔➤see JavaScript: Property Key "constructor"

〔➤see JavaScript: Object Object


〔➤see JavaScript: Object.prototype.hasOwnProperty


JavaScript: Find Object's Prototype


〔➤see JavaScript: Object.prototype.propertyIsEnumerable


ECMAScript 2015 §Fundamental Objects#sec-object.prototype.tolocalestring


〔➤see JavaScript: Object.prototype.toString


Object.prototype.valueOf ()

Returns a value of object type, by converting the value of thisBinding to a object type.

ECMAScript 2015 §Fundamental Objects#sec-object.prototype.valueof


ECMAScript 2015 §Fundamental Objects#sec-object.prototype

ECMAScript 2015 §Fundamental Objects#sec-properties-of-the-object-prototype-object

Object and Inheritance Topic

  1. JavaScript: Object System Overview
  2. JavaScript: What's Object?
  3. JavaScript: Prototype and Inheritance
  4. JavaScript: Creating Object
  5. JavaScript: Object Literal Expression {…}
  6. JavaScript: Find Object's Prototype
  7. JavaScript: How to Create Object with Parent X?
  8. JavaScript: Prevent Adding Property
  9. JavaScript: Determine Type of Object
  10. JavaScript: Primitive Types Object Wrapper
  11. JavaScript: Clone, Deep Copy Object/Array
  12. JavaScript: Test Equality of Objects

  1. JavaScript: Object Object
  2. JavaScript: Object.prototype
Like what you read? Buy JavaScript in Depth
or, buy a new keyboard, see Keyboard Reviews.