JavaScript Reflect.setPrototypeOf() MethodThe static Reflect.setPrototypeOf() method is used to set the prototype of a specified object to another object. The first argument is the object reference and the second argument can be either null or an object. This method is same as Object.setPrototypeOf() method. Syntax:Parameters:Obj: It is the target object of which to set the prototype. Prototype: It is the object's new prototype. Return value:This method returns a Boolean which indicates whether or not the prototype was successfully set. Exceptions:A TypeError, if the target is not an Object Browser Support:
Example 1Output: False Example 2Output: "Mitzie makes a noise." Example 3Output: answer value Next TopicJavaScript Reflect |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India