JS: Object.getPrototypeOf ❌

By Xah Lee. Date: . Last updated: .

🟢 TIP: better is Reflect.getPrototypeOf.

Object.getPrototypeOf(obj)
  • Return the parent of object obj.
  • If obj is not a object, it is converted to object first.
console.log(Object.getPrototypeOf({}) === Object.prototype);

JavaScript. Get Set Prototype