77
JavaScript Reflect.getPrototypeOf() Method
The static Reflect.getPrototypeOf() method is used to return the prototype of the specified object. It is same as the method Object.getProtptypeOf( ).
Syntax:
Parameters:
Obj: It is the target object of which to get the prototype.
Return value:
This method returns the prototype of the given object.
Exceptions:
A TypeError, if you give it an invalid target such as a Number or String literal, null or undefined.
Browser Support:
Chrome | 49 |
Edge | 12 |
Firefox | 42 |
Opera | 36 |
Example 1
Output:
true
Example 2
Output:
[object Object] { ... }
Example 3
Output:
null
Next TopicJavaScript Reflect