JS: Object.prototype
What is Object.prototype
Object.prototype is the value of the property key "prototype" of the function Object. 〔see Object Object〕
console.assert(Object.hasOwn(Object, "prototype") === true);
Type
Type of Object.prototype is Object
.
console.assert(typeof Object.prototype === "object");
Parent
Parent of Object.prototype is null.
console.assert(Reflect.getPrototypeOf(Object.prototype) === null);
Purpose
Object.prototype is the root parent of all standard objects.
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.
Properties
Function Properties
- JS: Object.prototype.hasOwnProperty ❌
- JS: Object.prototype.isPrototypeOf
- JS: Object.prototype.propertyIsEnumerable ❌
- JS: Object.prototype.toString
- JS: Object.prototype.valueOf
Object.prototype.toLocaleString
Data Property
Getter/Setter Property
JavaScript. Object and Inheritance
- JS: Object (basics)
- JS: Object Overview
- JS: Object Type
- JS: Test is Object Type 📜
- JS: Determine Type of Object
- JS: Prototype and Inheritance
- JS: Prototype Chain
- JS: Object.prototype.isPrototypeOf
- JS: Get Set Prototype
- JS: Show Prototype Chain 📜
- JS: Prototype Tree
- JS: Dot Notation and Prototype Chain
- JS: Create Object
- JS: Object Literal Expression
- JS: Object.create
- JS: Object Literal Expression vs Object.Create
- JS: Create Object with Parent X
- JS: Prevent Adding Property
- JS: Deep Copy Array or Object 📜
- JS: Test Equality of Array and Object by Content 📜
- JS: Add Method to Prototype
- JS: Object (class)
- JS: Object Constructor
- JS: Object.prototype