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
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -746,6 +746,7 @@ These methods are the most used ones, they cover 99% of use cases. But there are
746
746
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.
747
747
748
748
We can use `every` to compare arrays:
749
+
749
750
```js run
750
751
functionarraysEqual(arr1, arr2) {
751
752
returnarr1.length===arr2.length&&arr1.every((value, index) => value === arr2[index]);
0 commit comments