JS: Reflect.getPrototypeOf

By Xah Lee. Date: . Last updated: .

New in JS2015.

Reflect.getPrototypeOf(obj)
Return the parent object. Return null if no parent.

Throw a TypeError exception if obj is not a object.

Reflect.getPrototypeOf({}) === Object.prototype

Here is a example of no parent.

Reflect.getPrototypeOf(Object.create(null)) === null

JavaScript, Get Set Prototype

BUY ΣJS JavaScript in Depth