Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

isPrototypeOf Method (JavaScript)

Returns a Boolean value indicating whether an object exists in another object's prototype chain.



Required. Instance of an object.


Required. Another object whose prototype chain is to be checked.

The isPrototypeOf method returns true if object2 has object1 in its prototype chain. The prototype chain is used to share functionality between instances of the same object type. The isPrototypeOf method returns false when object2 is not an object or when object1 does not appear in the prototype chain of the object2.

The following example illustrates the use of the isPrototypeOf method.

function test(){
  var re = new RegExp();                        //Initialize variable.
  return (RegExp.prototype.isPrototypeOf(re));  //Return true.

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards. See Version Information.

Applies To: Object Object (JavaScript)

© 2015 Microsoft