You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/09-classes/06-instanceof/article.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ The algorithm of `obj instanceof Class` works roughly as follows:
55
55
For example:
56
56
57
57
```js run
58
-
// setup instanceOf check that assumes that
58
+
// setup instanceof check that assumes that
59
59
// anything with canEat property is an animal
60
60
classAnimal {
61
61
static [Symbol.hasInstance](obj) {
@@ -68,7 +68,7 @@ The algorithm of `obj instanceof Class` works roughly as follows:
68
68
alert(obj instanceof Animal); // true: Animal[Symbol.hasInstance](obj) is called
69
69
```
70
70
71
-
2. Most classes do not have `Symbol.hasInstance`. In that case, the standard logic is used:`obj instanceOf Class` checks whether `Class.prototype` is equal to one of the prototypes in the `obj` prototype chain.
71
+
2. Most classes do not have `Symbol.hasInstance`. In that case, the standard logic is used:`obj instanceof Class` checks whether `Class.prototype` is equal to one of the prototypes in the `obj` prototype chain.
0 commit comments