👾 just add another one missed break line
This commit is contained in:
parent
a85e802056
commit
60209e64d9
1 changed files with 1 additions and 0 deletions
|
@ -746,6 +746,7 @@ These methods are the most used ones, they cover 99% of use cases. But there are
|
||||||
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.
|
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.
|
||||||
|
|
||||||
We can use `every` to compare arrays:
|
We can use `every` to compare arrays:
|
||||||
|
|
||||||
```js run
|
```js run
|
||||||
function arraysEqual(arr1, arr2) {
|
function arraysEqual(arr1, arr2) {
|
||||||
return arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);
|
return arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue