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/05-data-types/05-array-methods/article.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -676,7 +676,7 @@ So `typeof` does not help to distinguish a plain object from an array:
676
676
677
677
```js run
678
678
alert(typeof {}); // object
679
-
alert(typeof []); // same
679
+
alert(typeof []); //object (same)
680
680
```
681
681
682
682
...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.
@@ -767,7 +767,7 @@ A cheat sheet of array methods:
767
767
-`reduce/reduceRight(func, initial)` -- calculate a single value over the array by calling `func` for each element and passing an intermediate result between the calls.
768
768
769
769
- Additionally:
770
-
-`Array.isArray(arr)` checks `arr` for being an array.
770
+
-`Array.isArray(value)` checks `value` for being an array, if so return true, otherwise false.
771
771
772
772
Please note that methods `sort`, `reverse` and `splice` modify the array itself.
0 commit comments