![]() |
VOOZH | about |
The Object.setPrototypeOf() method in JavaScript is a standard built-in object thatthat will sets the prototype (i.e., the internal [[Prototype]] property) of a specified object to another object or null.
Object.setPrototypeOf(obj, prototype)This method accepts two parameters as mentioned above and described below:
Example 1: In this example, we will set a prototype of an object using the Object.setPrototypeOf() Method in JavaScript.
Output:
"Geeksforgeeks"
"JavaScript "
"Object.isExtensible()"
Example 2: In this example, we will set a prototype of an object using the Object.setPrototypeOf() Method in JavaScript.
Output:
"GeeksforGeeks is Best platform"
"GeeksforGeeks provide jobs opportunity"
We have a complete list of Javascript Object methods, to check those please go through this JavaScript Object Complete Reference article.
The browsers supported by Object.setPrototypeOf() method are listed below: