Update article.md
instanceof is only looking for Animal.prototype in the prototype chain, don't Rabbit.prototype
This commit is contained in:
parent
193319c963
commit
91a89eac20
1 changed files with 1 additions and 1 deletions
|
@ -93,7 +93,7 @@ The algorithm of `obj instanceof Class` works roughly as follows:
|
||||||
alert(rabbit instanceof Animal); // true
|
alert(rabbit instanceof Animal); // true
|
||||||
*/!*
|
*/!*
|
||||||
|
|
||||||
// rabbit.__proto__ === Rabbit.prototype
|
// rabbit.__proto__ === Animal.prototype (no match)
|
||||||
*!*
|
*!*
|
||||||
// rabbit.__proto__.__proto__ === Animal.prototype (match!)
|
// rabbit.__proto__.__proto__ === Animal.prototype (match!)
|
||||||
*/!*
|
*/!*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue