Returns the accumulated result of calling fn on each item in an array, or the fallback if list is null or undefined.
fn
list
reduce(99)((acc, next) => acc + next)([3, 6, 9])// => 18reduce(99)((acc, next) => acc + next)(undefined)// => 99 Copy
reduce(99)((acc, next) => acc + next)([3, 6, 9])// => 18reduce(99)((acc, next) => acc + next)(undefined)// => 99
Generated using TypeDoc
Returns the accumulated result of calling
fn
on each item in an array, or the fallback iflist
is null or undefined.