Name

Object — a superclass that contains features of all JavaScript objects

Constructor

new Object()
new Object(value)

Arguments

value

This optional argument specifies a primitive JavaScript value—a number, boolean, or string—that is to be converted to a Number, Boolean, or String object.

Returns

If no value argument is passed, this constructor returns a newly created Object instance. If a primitive value argument is specified, the constructor creates and returns a Number, Boolean, or String object wrapper for the primitive value. When the Object() constructor is called as a function, without the new operator, it behaves just as it does when used with the new operator.

Properties

constructor

A reference to the JavaScript function that was the constructor for the object.

Methods

hasOwnProperty()

Checks whether an object has a locally defined (noninherited) property with a specified name.

isPrototypeOf()

Checks whether this object is the prototype object of a specified object.

propertyIsEnumerable()

Checks whether a named property exists and would be enumerated by a for/in loop.

toLocaleString()

Returns a localized string representation of the object. The default implementation of this method simply calls toString(), but subclasses may override it to provide localization.

toString()

Returns a string representation of the object. The implementation of this method provided by the Object class is quite generic and does not provide much useful information. Subclasses of Object typically override this method ...

Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.