|
March 11, 2001 Checking for a Prototype Chain Tips: March 2001
Yehuda Shiran, Ph.D.
|
|
Use the isPrototypeOf() method to find out if object2 had object1 in its prototype chain:
It returns true if object2 is an object and when object1 appears in the prototype chain of object2. Let's look at an example:
Ken is in the prototype chain of Employee, Person, and Object. Prove it to yourself by clicking on each class. They alert
People who read this tip also read these tips: Look for similar tips by subject: |
| ||||||||||||||||||||