Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

isPrototypeOf Method

Returns a Boolean value indicating whether an object exists in the prototype chain of another object.

function isPrototypeOf(obj : Object) : Boolean
obj

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

The isPrototypeOf method returns true if obj has the current object 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 obj is not an object or when the current object does not appear in the prototype chain of the obj.

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.
}

Other Resources

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.