February 2018
Intermediate to advanced
298 pages
8h 22m
English
The Reflect.getOwnPropertyDescriptor() method is used to retrieve the descriptor of an object's property.
The Reflect.getOwnPropertyDescriptor() method is the same as the Object.getOwnPropertyDescriptor() method. The Reflect. getOwnPropertyDescriptor() method takes two arguments. The first argument is the object and the second argument is the property name.
Here is an example to demonstrate the Reflect.getOwnPropertyDescriptor() method:
var obj = { name: "Eden" }; var descriptor = Reflect.getOwnPropertyDescriptor(obj, "name"); console.log(descriptor.value); console.log(descriptor.writable); console.log(descriptor.enumerable); console.log(descriptor.configurable);
The output is ...
Read now
Unlock full access