Javascript - Object Object.getOwnPropertyDescriptors()


Object.getOwnPropertyDescriptors(), new in ES2017, examines the description of all the own properties of the given object.

The property in a JavaScript object normally consists of a name that is a string and a property descriptor.

The descriptor is a record of the property value, Boolean writable, a get function, a set function, a Boolean configurable, and a Boolean enumerable.


const myObj = { 
    [Symbol('mySymbol')]: 42, 
    get random() { return 'test' }, 
}; /*w  ww.j a  va  2  s.  c  o  m*/