TypeScript Object
13 functions
Object.keysObject.keys(obj): string[]Returns an array of a given object's own enumerable string-keyed property names.
Object.valuesObject.values(obj): unknown[]Returns an array of a given object's own enumerable string-keyed property values.
Object.entriesObject.entries(obj): [string, unknown][]Returns an array of a given object's own enumerable string-keyed [key, value] pairs.
Object.fromEntriesObject.fromEntries(iterable): objectTransforms a list of key-value pairs into an object.
Object.assignObject.assign(target, ...sources): objectCopies all enumerable own properties from one or more source objects to a target object.
Object.freezeObject.freeze(obj): Readonly<T>Freezes an object so that no new properties can be added or removed.
Object.hasOwnObject.hasOwn(obj, key): booleanReturns a boolean indicating whether the object has the specified property as its own property. (ES2022)
Object.createObject.create(proto): objectCreates a new object, using an existing object as the prototype.
Object.getPrototypeOfObject.getPrototypeOf(obj): objectReturns the prototype of the specified object.
structuredClonestructuredClone<T>(value: T): TCreates a deep clone of the given value.
spreadconst merged = { ...obj1, ...obj2 }Merges objects using the spread syntax.
optional chainingobj?.prop?.nestedAccesses nested properties safely; returns undefined if any part is null/undefined.
nullish coalescingvalue ?? defaultValueReturns the right-hand operand when the left-hand operand is null or undefined.
