Some Important javascript Object methods

Sachin Jat
VirtouStack
3 min readApr 29, 2022

--

1.Object.values()

The Object.values() method returns an array of a given object's own enumerable property values

2.Object.seal()

The Object.seal() method seals an object, preventing new properties from being added to it and marking all existing properties as non-configurable. Values of present properties can still be changed as long as they are writable.

3.Object.preventExtensions()

The Object.preventExtensions() method prevents new properties from ever being added to an object.

4.Object.keys()

The Object.keys() method returns an array of a given object's own enumerable property names, iterated in the same order that a normal loop would.

5.Object.isSealed()

The Object.isSealed() method determines if an object is sealed.

6.Object.freeze()

The Object.freeze() method freezes an object. A frozen object can no longer be changed; freezing an object prevents new properties from being added to it, existing properties from being removed, prevents changing the enumerability, configurability, or writability of existing properties, and prevents the values of existing properties from being changed. In addition, freezing an object also prevents its prototype from being changed. freeze() returns the same object that was passed in.

7.Object.isFrozen()

The Object.isFrozen() determines if an object is frozen.

8.Object.isExtensible()

The Object.isExtensible() method determines if an object is extensible (whether it can have new properties added to it).

9.Object.is()

The Object.is() method determines whether two values are the same value.

10.Object.hasOwn()

The Object.hasOwn() static method returns true if the specified object has the indicated property as its own property. If the property is inherited, or does not exist, the method returns false.

11.Object.assign()

The Object.assign() method copies all enumerable own properties from one or more source objects to a target object. It returns the modified target object.

--

--