82
JavaScript Reflect.get() Method
The static Reflect.get() method is used to retrieve the property from an object as a function. The first argument is the object and the second argument is the property name.
Syntax:
Parameters:
target: It is the target object on which to get the property.
propertyKey: It is the name of the key to get.
receiver: It is the value of this provided for the call to object if a getter is encountered.
Return value:
It returns the value of the property.
Exceptions:
A TypeError, if the target is not an Object.
Browser Support:
Chrome | 49 |
Edge | 12 |
Firefox | 42 |
Opera | 36 |
Example 1
Output:
true true false
Example 2
Output:
true
Example 3
Output:
2 "charry"
Next TopicJavaScript Reflect