ObjectgetPrototypeOf
Object.getPrototypeOf is a built-in JavaScript function that retrieves the prototype of a given object. It is a static method on the Object constructor and is defined by the ECMAScript 5 standard. The prototype retrieved is the value of the object's internal [[Prototype]] slot, which underpins property inheritance in JavaScript objects.
Syntax and behavior: Object.getPrototypeOf(object) returns the object's immediate prototype. If the argument is a primitive value,
Examples: Object.getPrototypeOf({}) yields Object.prototype; Object.getPrototypeOf([]) yields Array.prototype; Object.getPrototypeOf(function(){}) yields Function.prototype. For an object created with no
Usage notes: Object.getPrototypeOf is the standard and recommended way to inspect an object's prototype. It is
Compatibility: Introduced in ES5 and supported by all modern browsers and Node.js versions.