InterviewSolution
Saved Bookmarks
| 1. |
To determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the ____________(a) isPrototypeOf() method(b) equals() method(c) === operator(d) ==opertorThis question was posed to me during an interview for a job.The question is from Object Attributes and Serialization in division Lexical Structures of JavaScript |
|
Answer» RIGHT option is (a) isPrototypeOf() method To EXPLAIN I would say: Prototype is a global property which is available with ALMOST all the objects. To determine whether one object is the prototype of (or is part of the prototype CHAIN of) another object, one should use the isPrototype() method. To find out if P is the prototype of o write p.isPrototypeOf(o). |
|