Object.assign(target, ...sources) |
copies properties from one or more source objects to target object |
Object.create(proto, [propertiesObject]) |
creates new object, using an existing object as the prototype |
Object.defineProperty[ies](obj, prop, descriptor) |
defines new or modifies existing property |
Object.entries(obj) |
returns array of object's [key, value] pairs |
Object.freeze(obj) |
freezes an object, which then can no longer be changed |
Object.fromEntries() |
transforms a list of key-value pairs into an object |
Object.getOwnPropertyDescriptor[s](obj, prop) |
returns a property descriptor / all own property descriptors for an own property |
Object.getOwnPropertyNames(obj) |
returns array of all properties |
Object.getOwnPropertySymbols(obj) |
array of all symbol properties |
Object.getPrototypeOf(obj) |
returns the prototype |
Object.is(value1, value2) |
determines whether two values are the same value |
Object.isExtensible(obj) |
determines wether an object can have new properties added to it |
Object.isFrozen(obj) Object.isSealed(obj) |
determines if an object is frozen / sealed |
Object.keys(obj) |
returns array of object's enumerable property names |
Object.preventExtensions(obj) |
prevents new properties from being added to an object |
obj.hasOwnProperty(prop) |
returns boolean indicating whether object has the specified property |
prototypeObj.isPrototypeOf(object) |
checks if object exists in another object's prototype chain |
obj.propertyIsEnumerable(prop) |
checks whether the specified property is enumerable and is the object's own property |
obj.toString() |
returns a string representing the object |
Object.seal(obj) |
prevents new properties from being added and marks all existing properties as non-configurable |
Object.values(obj) |
returns array of object's own enumerable property values |
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets