1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
{{alias}}( value, proto )
Tests if an object's prototype chain contains a provided prototype.
The function returns `false` if provided a primitive value.
This function is generally more robust than the `instanceof` operator (e.g.,
where inheritance is performed without using constructors).
Parameters
----------
value: any
Input value.
proto: Object|Function
Prototype.
Returns
-------
bool: boolean
Boolean indicating if a provided prototype exists in a prototype chain.
Examples
--------
> function Foo() { return this; };
> function Bar() { return this; };
> {{alias:@stdlib/utils/inherit}}( Bar, Foo );
> var bar = new Bar();
> var bool = {{alias}}( bar, Foo.prototype )
true
See Also
--------
|