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

ChromeCompatibility unknown
EdgeCompatibility unknown
Firefox49
OperaCompatibility unknown

Example 1

Test it Now

Output:

true

Example 2

Test it Now

Output:

false

Example 3

Test it Now

Output:

false
false





Latest Courses