The Reflect.getPrototypeOf(object) method

The Reflect.getPrototypeOf() method is used to retrieve the prototype of an object--that is, the value of the internal [[prototype]] property of an object.

The Reflect.getPrototypeOf() method is the same as the Object.getPrototypeOf() method.

Here is a code example that demonstrates how to use the Reflect. getPrototypeOf() method:

var obj1 = { __proto__:  { name: "Eden" } }; var obj2 = Reflect.getPrototypeOf(obj1); console.log(obj2.name); //Output "Eden"

Get Learn ECMAScript - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.