Object.values() JavaScript

The Javascript Object values() method retrieves an array of direct enumerable property values. Syntax: Object.values(object) Parameters: object: It represents the object whose enumerable property values have to be retrieved. Return: An array of direct enumerable property values. Example: <!DOCTYPE html> <html> <body> <script> const obj = { a: ‘TOM’, b: ‘JONAS’ }; document.write(Object.values(obj)); </script> </body> … Read more

Object.setPrototypeOf() JavaScript JS

The Javascript Object setPrototypeOf() method sets the prototype of a specified object to another object. Prototype can be another object or null. Syntax: Object.setPrototypeOf(object, prototype) Parameters: object: It represents the object whose prototype has to be set. prototype: It represents the new prototype. Return: Specified Object Example: <!DOCTYPE html> <html> <body> <script> let jewel = … Read more

Object.seal() JavaScript

The JavaScript Object seal() method prevents any new properties from being added and marks all existing properties as non-configurable. Syntax: Object.seal(object) Parameters: seal: It represents the object which has to be sealed. Return: Sealed Object. Example: <!DOCTYPE html> <html> <body> <script> const a = { prop: ‘HELLO’}; const b = Object.seal(a); b.prop = ‘WORLD’; document.write(b.prop); … Read more

Object.preventExtensions() JavaScript

The Javascript Object preventExtensions() method prevents any extensions of an object i.e. no new property can be added and no existing property can be modified. Note: Prevention on an object will be permanent and the object cannot be extensible again after applying prevention. Syntax: Object.preventExtensions(object) Parameters: object: It represents the object that has to be … Read more

Object.is() JavaScript JS

The Javascript Object is() method determines whether two values are of the same value. Syntax: Object.is(value1, value2) Parameters: value1: It represents the first value to be compared. value2: It represents the second value to be compared. Return: It returns true if two values are of the same value otherwise returns false. Two values are considered … Read more

Object.getPrototypeOf() JavaScript

The JavaScript Object getPrototypeOf() method retrieves the prototype of the specified object. It will return null if there are no inherited properties. Syntax: Object.getPrototypeOf(object) Parameters: object: It represents the prototype of the specified object. Return: Prototype of the specified object. Example: <!DOCTYPE html> <html> <body> <script> const proto = {}; const obj = Object.create(proto); document.write(Object.getPrototypeOf(obj) … Read more

Object.getOwnPropertySymbols() JavaScript JS

The Javascript Object getOwnPropertySymbols() method retrieves an array of all its own symbol key properties. It will return an empty array if no symbol property is directly associated with an object. Syntax: Object.getOwnPropertySymbols(object) Parameters: object: It represents the object whose symbol properties have to be fetched. Return: An array of all own symbol key properties. … Read more

Object.getOwnPropertyNames() JavaScript

The Javascript Object getOwnPropertyNames() method retrieves an array of all direct properties of the object. It will exclude non-enumerable properties which use symbols. Syntax: Object.getOwnPropertyNames(object) Parameters: object: It represents the object whose all direct properties have to be fetched. Return: An array of all direct properties of the object. Example: <!DOCTYPE html> <html> <body> <script> … Read more

Object.getOwnPropertyDescriptors() JavaScript JS

The Javascript Object getOwnPropertyDescriptors() method retrieves all own property descriptors of an object. It will return an empty object if there is no property associated with the Object. Syntax: Object.getOwnPropertyDescriptors(object) Parameters: object: It represents the object whose own property descriptors have to be fetched. Return: All own property descriptors of the specified object. Example: <!DOCTYPE … Read more

Object.getOwnPropertyDescriptor() JavaScript JS

The Javascript Object getOwnPropertyDescriptor() method retrieves a property descriptor for the specified property of the specified object. Syntax: Object.getOwnPropertyDescriptor(object, property) Parameters: object: It represents the object whose property descriptor has to be fetched. Return: A property descriptor for the specified property. Example: <!DOCTYPE html> <html> <body> <script> const obj = { prop: 56 } const … Read more