Skip to content

Commit c29689a

Browse files
committed
minor fixes
1 parent 23047ab commit c29689a

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
@@ -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(value)` checks `value` for being an array, if so return true, otherwise false.
770+
- `Array.isArray(value)` checks `value` for being an array, if so returns `true`, otherwise `false`.
771771

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

@@ -780,7 +780,7 @@ These methods are the most used ones, they cover 99% of use cases. But there are
780780
These methods behave sort of like `||` and `&&` operators: if `fn` returns a truthy value, `arr.some()` immediately returns `true` and stops iterating over the rest of items; if `fn` returns a falsy value, `arr.every()` immediately returns `false` and stops iterating over the rest of items as well.
781781

782782
We can use `every` to compare arrays:
783-
783+
784784
```js run
785785
function arraysEqual(arr1, arr2) {
786786
return arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);

0 commit comments

Comments
 (0)