JavaScript: Object Object
Object
is the value of the property key "Object"
of the Global Object
.
console.log( window.Object === Object ); // true
Type
Type of Object
is a function.
console.log( typeof Object === "function" ); // true
Parent
Parent of Object
is Function.prototype
.
console.log( Reflect.getPrototypeOf ( Object ) === Function.prototype ); // true
Purpose
Purpose of Object
is:
- To convert primitive value (such as string, number, boolean) to a object. (by
Object(âŠ)
) - Used as a namespace to hold general purpose methods for working with objects. For example,
Object.isExtensible(âŠ)
. - Holds the property key
"prototype"
. The value ofObject.prototype
is the root parent object of all standard objects. (so they inherit useful methods.) [see Prototype and Inheritance]
For tutorial, see Object Overview .