getPrototype()function

getPrototype(obj: T): Partial<T> | null
ParamType
objT
The object to read the prototype from. required
Return
Partial<T> | null
The prototype of the object, or null if it has none.

Get the prototype of an object instance.

  • Recommend to use this because Typescript's default lib specifies Object.getPrototypeOf() returning any.

Examples

getPrototype({ a: 1 }); // Object.prototype