JavaScript Object.getPrototypeOf() Method

The Object.getPrototypeOf() method of JavaScript returns the prototype (i.e. the value of the internal [[Prototype]] property) of the specified object.

Syntax:

Parameter

obj: It is an object whose prototype is to be returned.

Return value:

This method returns the prototype of the given object. If there are no inherited properties, this method will return null.

Browser Support:

Chrome5
EdgeYes
Firefox3.5
Opera12.1

Example 1

Output:

true

Example 2

Output:

true
false

Example 3

Output:

true
true





Latest Courses