Favorites

JavaScript Object.getPrototypeOf() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Object.getPrototypeOf()
JavaScript Object Static methodThis method is supported by all modern browsers.
Updated 28th November 2026

The Object.getPrototypeOf() static method returns the prototype of an object: the object it inherits properties from.

Description

The Object.getPrototypeOf() static method returns the prototype of an object, the object that it inherits from. It is the standard replacement for the old __proto__ property. The matching Object.setPrototypeOf() changes a prototype, but doing so is slow and best avoided.

Prototype chains end with Object.prototype, whose own prototype is null. Walking up the chain with repeated calls shows every object a value inherits from, which can help when debugging how a class hierarchy is put together.

Primitive values are converted to their wrapper objects first, so Object.getPrototypeOf('a') is String.prototype. For checking whether an object inherits from a class, the instanceof operator or isPrototypeOf() are usually more direct.

Syntax

Object.getPrototypeOf(obj)

Parameters

  • objThe object to work with.

Return Value

The prototype of the object, or null if it has none.

Example

console.log(Object.getPrototypeOf([]) === Array.prototype);
class Animal {}
class Dog extends Animal {}
console.log(Object.getPrototypeOf(Dog.prototype) === Animal.prototype);
console.log(Object.getPrototypeOf(Object.create(null)));

Browser Support

The following information will show you the current browser support for the Object.getPrototypeOf() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee