- our array = [ 1, 2, 3, 4, 5 ]
- To get total value of the array we use reduce method
- .reduce() method take a callback function with
two arguments(reducer(or accumulataor) and current value) - array.reduce((acc, currentVal) => acc + cV) = 15
git clone https://github.com/GoogleNanodegreeScholarship/reduce
cd reduce
npm install