References
Array.reduceRight()
Leírás
Mint a reduce, csak jobbról-balra halad.
Szintaxis
reduceRight(callbackFn)
reduceRight(callbackFn, initialValue)Példa
const array1 = [
[0, 1],
[2, 3],
[4, 5],
]
const result = array1.reduceRight((accumulator, currentValue) => accumulator.concat(currentValue))
console.log(result)
// Expected output: Array [4, 5, 2, 3, 0, 1]