Object.getPrototypeOf()

ES5+

Returns the prototype of the specified object.

Syntax

Object.getPrototypeOf(obj)

Parameters

obj Object

The object whose prototype is to be returned

Return Value

Object | null

The prototype of the given object

Examples

JavaScript
const arr = [1, 2, 3];
console.log(Object.getPrototypeOf(arr) === Array.prototype);
Output:
// true

Related Methods