👾 smth
This commit is contained in:
parent
7964b11b8f
commit
04c113ce33
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue