The Object.create() method is used to create a new object and link it to the prototype of an existing objet. We can create a job object instance, and extend it to a more specific object.
Object.keys() creates an array containing the keys of an object. We create an object and print the arrays of keys
Object.values() creates an array containing the values of an object.
Object.entries() creates a nested array of the key / value pairs of an object.
Object.assign() is used to copy values from one object to another. We create two objects, and merge them with Object.assign()
Object.freeze() prevents modification to properties and values of an object, and prevent properties from being added or removed from an object.
Object.seal() prevents new properties from being added to an object, but allows the modification of existing properties. This method is similar to Object.freeze(). Refresh your console before implementing the code below to avoid any error
Object.getPrototypeOf() is used to get the internal hidden [[Prototype]] of an object, also accessible through the __proto__ property. In this example, we can create an array, which has access to the Array prototype.
Object.setPrototypeOf() static method sets the prototype (i.e., the internal [[Prototype ]] property) of a specified object to another object or null.
1. Visit Saqibz.com 2. Subscribe to our newsletter 3. Never miss a Post