← Reference

Object Methods

Static methods on the Object constructor.

Object.assign()

Copy enumerable properties from one or more source objects to a target object, returning the modified target.

Object.assign(target, ...sources)

Object.create()

Create a new object with the specified prototype and properties.

Object.create(proto, propertiesObject?)

Object.defineProperty()

Define or modify a property directly on an object with precise control over its attributes.

Object.defineProperty(obj, prop, descriptor)

Object.entries()

Returns an array of a given object's own enumerable string-keyed [key, value] pairs.

Object.entries(obj)

Object.freeze()

Prevent modifications to an object. Makes it immutable - you cannot add, remove, or modify any properties.

freeze(obj)

Object.fromEntries()

Convert an iterable of key-value pairs into an object, enabling easy transformation from Maps, Arrays, or other iterables.

Object.fromEntries(iterable)

Object.getPrototypeOf()

Return the prototype (internal [[Prototype]]) of the specified object.

getPrototypeOf(obj)

Object.hasOwn()

Check if a property exists as an own property on an object.

Object.hasOwn(obj, prop)

Object.is()

Compares two values for equality, with special handling for NaN, zeros, and object identity.

Object.is(value1, value2)

Object.keys()

Returns an array of a given object's own enumerable string-keyed property names.

Object.keys(obj)

Object.seal()

Restrict an object by preventing new properties from being added or removed, but allowing existing properties to be modified.

seal(obj)

Object.setPrototypeOf()

Set the prototype (internal [[Prototype]]) of the specified object to another object or null.

setPrototypeOf(obj, prototype)