Standard built-ins
Object.getOwnPropertyDescriptors()
Returns an object mapping all own keys, including symbols and non-enumerable keys, to descriptor objects.
Formal Syntax & Structure
javascript syntaxjavascript
Object.getOwnPropertyDescriptors(obj)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| obj | Object | Target object. |
Return Value
Object
Mapping of descriptors.
Working Example
Example Snippetjavascript
const o={};Object.defineProperty(o,"id",{value:4});console.log(Object.getOwnPropertyDescriptors(o).id.value);