Skip to content

Commit 392b191

Browse files
authored
Merge pull request #3008 from Rnbsov/patch-45
👾 just add missed break line
2 parents c3b904d + 60209e6 commit 392b191

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ Literally, all elements are converted to strings for comparisons. For strings, l
423423
To use our own sorting order, we need to supply a function as the argument of `arr.sort()`.
424424
425425
The function should compare two arbitrary values and return:
426+
426427
```js
427428
function compare(a, b) {
428429
if (a > b) return 1; // if the first value is greater than the second
@@ -667,7 +668,6 @@ So it's advised to always specify the initial value.
667668

668669
The method [arr.reduceRight](mdn:js/Array/reduceRight) does the same, but goes from right to left.
669670

670-
671671
## Array.isArray
672672

673673
Arrays do not form a separate language type. They are based on objects.
@@ -780,6 +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+
783784
```js run
784785
function arraysEqual(arr1, arr2) {
785786
return arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);

0 commit comments

Comments
 (0)