getPrototype()function
getPrototype(obj: T): Partial<T> | null
| Param | Type | |
|---|---|---|
obj | T | 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()returningany.
Examples
getPrototype({ a: 1 }); // Object.prototype