Export (0) Print
Expand All

isPrototypeOf Method

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

function isPrototypeOf(obj : Object) : Boolean

Arguments

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

Remarks

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.

Example

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

Requirements

Version 5.5

See Also

Methods

Applies To: Object Object

Show:
© 2014 Microsoft