83
JavaScript handler.setPrototypeOf() Method
The handler.setPrototypeOf method returns a Boolean value true if [[Prototype]] was successfully changed. Otherwise, it will return false. It is a trap for Object.setPrototypeOf().
Syntax
Parameters
target: The target object.
prototype: The object’s new prototype or null.
Return value
Return a Boolean type value.
Browser Support
Chrome | Compatibility unknown |
Edge | Compatibility unknown |
Firefox | 49 |
Opera | Compatibility unknown |
Example 1
Output:
true
Example 2
Output:
false
Example 3
Output:
false false
Next TopicJavaScript handler