Skip to content

Commit 23047ab

Browse files
authored
Merge pull request #3073 from Rnbsov/patch-70
Minor change to array methods article
2 parents 2293559 + 3e72030 commit 23047ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

1-js/05-data-types/05-array-methods/article.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ So `typeof` does not help to distinguish a plain object from an array:
676676

677677
```js run
678678
alert(typeof {}); // object
679-
alert(typeof []); // same
679+
alert(typeof []); // object (same)
680680
```
681681

682682
...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:
767767
- `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.
768768

769769
- 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.
771771

772772
Please note that methods `sort`, `reverse` and `splice` modify the array itself.
773773

0 commit comments

Comments
 (0)