commit
75cdd64d4b
1 changed files with 1 additions and 1 deletions
|
@ -46,7 +46,7 @@ alert( arr instanceof Object ); // true
|
|||
|
||||
Please note that `arr` also belongs to the `Object` class. That's because `Array` prototypally inherits from `Object`.
|
||||
|
||||
The `instanceof` operator examines the prototype chain for the check, but we can set a custom logic the static method `Symbol.hasInstance`.
|
||||
The `instanceof` operator examines the prototype chain for the check, but we can set a custom logic in the static method `Symbol.hasInstance`.
|
||||
|
||||
The algorithm of `obj instanceof Class` works roughly as follows:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue