Object.getOwnPropertyDescriptor

suggest change

Get the descriptor of a specific own property. The call returns undefined when the object has no own property by that key. An accessor property’s descriptor has get and set instead of value and writable.

const sampleObject = {
    hello: 'world'
};

Object.getOwnPropertyDescriptor(sampleObject, 'hello');
// Object {value: "world", writable: true, enumerable: true, configurable: true}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents