JavaScript Object.getOwnPropertyDescriptors() Method

The Object.getOwnPropertyDescriptors() method returns all own property descriptors of a given object. The difference between getOwnPropertyDescriptors() and getOwnPropertyDescriptor() method is that getOwnPropertyDescriptors() method ignores symbolic properties.

Syntax:

Parameter

obj: It is the object for which to get all own property descriptors.

Return:

This method returns an object which contains all own property descriptors of an object. This method might return an empty object if there are no properties.

Browser Support:

Chrome54
Edge15
Firefox50
Opera41

Example 1

Output:

103

Example 2

Output:

[object Object] {
  configurable: true,
  enumerable: true,
  value: 22,
  writable: true
}
true

Example 3

Output:

true
42 
23





Latest Courses