is-prototype-of-x
Checks if an object exists in another object's prototype chain.
module.exports(proto, object)
⇒ boolean
⏏
This method checks if an object exists in another object's prototype chain.
Kind: Exported function
Returns: boolean
- Does the proto object lay in the prototype chain of object.
Throws:
TypeError
If proto is undefined or null.
Param | Type | Description |
---|---|---|
proto | Object |
The proto object to search for. |
object | Object |
The object whose prototype chain will be searched. |
Example
; {} {} {} Barprototype = Object;Bazprototype = Object; const baz = ; console; // trueconsole; // trueconsole; // trueconsole; // true