Object.keys() | Returns object keys. | Object.keys({ name: "John", age: 30 }) | ["name", "age"] |
Object.values() | Returns object values. | Object.values({ name: "John", age: 30 }) | ["John", 30] |
Object.entries() | Returns key-value pairs. | Object.entries({ name: "John" }) | [["name", "John"]] |
Object.fromEntries() | Creates object from entries. | Object.fromEntries([["name", "John"]]) | { name: "John" } |
Object.assign() | Copies properties into target object. | Object.assign({}, { a: 1 }, { b: 2 }) | { a: 1, b: 2 } |
Object.create() | Creates object with a prototype. | Object.create({ type: "user" }) | New object with prototype |
Object.freeze() | Prevents adding, deleting, or updating properties. | Object.freeze({ name: "John" }) | Frozen object |
Object.isFrozen() | Checks if object is frozen. | Object.isFrozen(Object.freeze({})) | true |
Object.seal() | Prevents adding or deleting properties. | Object.seal({ name: "John" }) | Sealed object |
Object.isSealed() | Checks if object is sealed. | Object.isSealed(Object.seal({})) | true |
Object.preventExtensions() | Prevents adding new properties. | Object.preventExtensions({ name: "John" }) | Non-extensible object |
Object.isExtensible() | Checks if object can be extended. | Object.isExtensible({}) | true |
Object.hasOwn() | Checks if object has its own property. | Object.hasOwn({ name: "John" }, "name") | true |
hasOwnProperty() | Checks if property exists directly on object. | ({ name: "John" }).hasOwnProperty("name") | true |
Object.is() | Compares two values accurately. | Object.is(NaN, NaN) | true |
Object.getPrototypeOf() | Returns object prototype. | Object.getPrototypeOf({}) | Object.prototype |
Object.setPrototypeOf() | Sets object prototype. | Object.setPrototypeOf(obj, proto) | Updated object |
Object.defineProperty() | Defines one property with descriptor. | Object.defineProperty(obj, "id", { value: 1 }) | Object with id property |
Object.defineProperties() | Defines multiple properties. | Object.defineProperties(obj, { id: { value: 1 } }) | Object with multiple properties |
Object.getOwnPropertyDescriptor() | Returns descriptor for one property. | Object.getOwnPropertyDescriptor(obj, "name") | Descriptor object |
Object.getOwnPropertyDescriptors() | Returns descriptors for all properties. | Object.getOwnPropertyDescriptors(obj) | Descriptors object |
Object.getOwnPropertyNames() | Returns own property names. | Object.getOwnPropertyNames({ a: 1 }) | ["a"] |
Object.getOwnPropertySymbols() | Returns symbol properties. | Object.getOwnPropertySymbols(obj) | [Symbol()] |
Object.groupBy() | Groups items by callback result. | Object.groupBy(users, user => user.role) | { admin: [...], user: [...] } |