Skip to content

Commit

Permalink
Improve readability and consistency of array-reduce examples (#1454)
Browse files Browse the repository at this point in the history
Co-authored-by: Schalk Neethling <schalk.neethling@mechanical-ink.co.za>
  • Loading branch information
IAmFletcher and Schalk Neethling authored May 14, 2022
1 parent f670798 commit c089a64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions live-examples/js-examples/array/array-reduce-right.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const array1 = [[0, 1], [2, 3], [4, 5]].reduceRight(
(accumulator, currentValue) => accumulator.concat(currentValue)
);
const array1 = [[0, 1], [2, 3], [4, 5]];

console.log(array1);
const result = array1.reduceRight((accumulator, currentValue) => accumulator.concat(currentValue));

console.log(result);
// expected output: Array [4, 5, 2, 3, 0, 1]

0 comments on commit c089a64

Please sign in to comment.