Skip to content

Commit 91a89ea

Browse files
authored
Update article.md
instanceof is only looking for Animal.prototype in the prototype chain, don't Rabbit.prototype
1 parent 193319c commit 91a89ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

1-js/09-classes/06-instanceof/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The algorithm of `obj instanceof Class` works roughly as follows:
9393
alert(rabbit instanceof Animal); // true
9494
*/!*
9595
96-
// rabbit.__proto__ === Rabbit.prototype
96+
// rabbit.__proto__ === Animal.prototype (no match)
9797
*!*
9898
// rabbit.__proto__.__proto__ === Animal.prototype (match!)
9999
*/!*

0 commit comments

Comments
 (0)