Skip to main content


reduces the array to a single value

reduce<A>(callback: ReduceCallBack<T, A>, acc: A): A;


  • callback: function - a function that will be called for each item in the array
  • acc: any - a value to be passed to the function as the initial value


A single output value.


const total =, item) {
return new_item + item.value;
}, 0);

Related sample: Data. Reduce

A handler function takes two parameters:

new_item(any) the initialValue, or the previously returned value of the function
item(any) the current item of a data collection