Update article.md

Updated based on comments
This commit is contained in:
hrodward 2019-10-29 22:04:43 +01:00 committed by GitHub
parent c4914ae803
commit 028b408c29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,7 +68,7 @@ The algorithm of `obj instanceof Class` works roughly as follows:
alert(obj instanceof Animal); // true: Animal[Symbol.hasInstance](obj) is called alert(obj instanceof Animal); // true: Animal[Symbol.hasInstance](obj) is called
``` ```
2. Most classes do not have `Symbol.hasInstance`. In that case, the standard logic is used: `obj instanceOf Class` checks whether `Class.prototype` equals to any prototype in the `obj` prototype chain. 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.
In other words, compare one after another: In other words, compare one after another:
```js ```js