Home >Web Front-end >JS Tutorial >Function and usage examples of isPrototypeOf function in JavaScript_javascript skills
The isPrototypeOf function method in JavaScript returns a Boolean value indicating whether the object exists in the prototype chain of another object. How to use:
If the prototype chain of object2 contains object1, then the isPrototypeOf function method in JavaScript returns true.
Prototype chains can be used to share functionality between different instances of the same object type.
If object2 is not an object or object1 does not appear in the prototype chain in object2, the isPrototypeOf function method in JavaScript will return false.
The following example illustrates the usage of isPrototypeOf function method in JavaScript.