Object.getOwnPropertyDescriptor
suggest changeGet 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}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents