JavaScript isPrototypeOf() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Object

Definition

proto.isPrototypeOf(obj) returns true when proto appears anywhere in obj’s prototype chain.

It is about objects, not constructor functions. For class or constructor checks, people often use instanceof. To read the direct prototype, use Object.getPrototypeOf.

Syntax

Call obj.isPrototypeOf() like this. Start with this line.

JavaScript
proto.isPrototypeOf(obj)
CallWhat it does
proto.isPrototypeOf(obj)True if proto is in obj’s chain.
Object.prototype.isPrototypeOf({})True for normal objects that inherit from Object.prototype.
Object.getPrototypeOf(obj) === protoChecks only the direct prototype, not the whole chain.

Call on the candidate prototype. Pass the object you want to test.

Library declarations
JavaScript
proto.isPrototypeOf(obj)
JavaScript
object.isPrototypeOf(v: any): boolean

Parameters

ParameterDescription
objRequired. The object whose prototype chain you want to search.

Return Value

Return ValueDescription
booleantrue if this value is a prototype of obj; otherwise false.

JavaScript Examples

Check a Prototype Link

Create an object with Object.create and test the chain.

JavaScript
var animal = { kind: "animal" };
var dog = Object.create(animal);
dog.bark = function () { return "woof"; };

console.log(animal.isPrototypeOf(dog));
console.log(Object.prototype.isPrototypeOf(dog));
console.log(dog.isPrototypeOf(animal));
Try It Yourself

How It Works

  1. Direct link. animal is the prototype of dog, so the first check is true.
  2. Longer chain. Normal objects also inherit from Object.prototype.
  3. Direction matters. dog is not a prototype of animal.

Works for Deeper Chains

Grandparent prototypes still count.

JavaScript
var a = { level: "a" };
var b = Object.create(a);
var c = Object.create(b);

console.log(a.isPrototypeOf(c));
console.log(b.isPrototypeOf(c));
console.log(Object.getPrototypeOf(c) === b);
Try It Yourself

How It Works

  1. Grandparent. a.isPrototypeOf(c) is true even though b sits in between.
  2. Parent. b is also on the chain.
  3. Direct only. getPrototypeOf(c) is exactly b, not a.

Null-Prototype Objects Break the Chain

Objects with a null prototype do not inherit from Object.prototype.

JavaScript
var dict = Object.create(null);
dict.x = 1;

console.log(Object.prototype.isPrototypeOf(dict));
console.log(Object.getPrototypeOf(dict));
console.log(Object.getPrototypeOf({}) === Object.prototype);
Try It Yourself

How It Works

  1. Not in chain. Object.prototype.isPrototypeOf(dict) is false.
  2. Prototype is null. getPrototypeOf(dict) returns null.
  3. Normal objects differ. A plain {} still links to Object.prototype.

Browser & Runtime Support

isPrototypeOf() has been available since early JavaScript (ES1) and is Baseline in all environments.

✓ ES1 · Baseline

obj.isPrototypeOf()

Supported everywhere. Useful for manual prototype checks without constructors.

100% Browser support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
Object.prototype.isPrototypeOf Excellent

Bottom line: Use freely. For class instances, instanceof is often the more common check.

Frequently Asked Questions

It returns true if the object you call it on appears in another object’s prototype chain.
instanceof checks a constructor’s prototype. isPrototypeOf checks an actual object as a prototype.
No. It searches the whole chain.
proto.isPrototypeOf(null) returns false.
Prefer Object.create(proto) for new objects, or Object.setPrototypeOf for existing ones.

Next: propertyIsEnumerable()

Check whether an own property shows up in loops.

propertyIsEnumerable() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful