👾 smth

This commit is contained in:
Lavrentiy Rubtsov 2022-06-20 23:01:19 +06:00 committed by GitHub
parent 7964b11b8f
commit 04c113ce33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -676,7 +676,7 @@ So `typeof` does not help to distinguish a plain object from an array:
```js run
alert(typeof {}); // object
alert(typeof []); // same
alert(typeof []); // object (same)
```
...But arrays are used so often that there's a special method for that: [Array.isArray(value)](mdn:js/Array/isArray). It returns `true` if the `value` is an array, and `false` otherwise.