JavaScript: Object.prototype
Object.prototype
is the value of the property key "prototype"
of the function Object
. [see Object Object]
console.log( Object.hasOwnProperty ( "prototype" ) );
Type
Type of Object.prototype
is Object
.
console.log( typeof Object.prototype === "object" );
Parent
Parent of Object.prototype
is null.
console.log( 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
- hasOwnProperty
- isPrototypeOf
- propertyIsEnumerable
- toString
toLocaleString
- valueOf
Data Property
Getter/Setter Property
JavaScript Object and Inheritance
- Object Basics
- Object Overview
- Object Type
- Test If a Value is Object Type ð
- Find Object's Type
- Prototype and Inheritance
- Prototype Chain
- Is in Prototype Chain?
- Get/Set Parent
- Show Parent Chain ð
- Create Object
- Object Literal Expr
- Create Object + Parent
- Prevent Adding Property
- Clone Object ð
- Test Object Equality ð
- Add Method to Prototype