npm.io
0.2.1 • Published 7 years ago

@skt-t1-byungi/array-reduce-right

Licence
MIT
Version
0.2.1
Deps
0
Size
2 kB
Vulns
0
Weekly
0

@skt-t1-byungi/array-reduce-right

reduceRight() for old browser, in typescript.

Example

const reducer = (acc, v) => {
  console.log(v)
  return acc + v
}
reduceRight([1, 2, 3], reducer, 0)
// 3
// 2
// 1
// => 6

reduceRight(array, reducer, [initValue])

array

Target array.

reducer

Function to execute on each element in the array. accumulates return values.

initValue

Value to use as the first argument to the first call.

License

MIT

Keywords