Which method is used to get the prototype of an object?

The story behind the answer

The method used to get an object’s prototype is Object.getPrototypeOf().

In JavaScript, every ordinary object has an internal [[Prototype]] reference, which links it to another object in the prototype chain or to null. Object.getPrototypeOf(object) reads that reference and returns the actual prototype. For example, Object.getPrototypeOf([]) is Array.prototype, while Object.getPrototypeOf(Object.prototype) is null.

Several similarly named choices cause confusion. __proto__ can expose the same relationship through a legacy accessor, but it is discouraged in modern code. prototype is usually a property of constructor functions; it is the object assigned as the prototype of instances created with new, not a general method for reading an existing object’s prototype. Object.setPrototypeOf() changes a prototype rather than retrieving one.

Reflect.getPrototypeOf() is the closely related Reflect API equivalent. Object.getPrototypeOf() has been standardized since ECMAScript 5 and is the conventional answer for this question.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: