Home » JavaScript handler setPrototypeOf() Method

JavaScript handler setPrototypeOf() Method

by Online Tutorials Library

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

Test it Now

Output:

true  

Example 2

Test it Now

Output:

false  

Example 3

Test it Now

Output:

false  false  

Next TopicJavaScript handler

You may also like