js string reduc code example
Example 1: es6 array sum javascript
const arrSum = arr.reduce((a,b) => a + b, 0);
Example 2: syntax of reduce in js
[1,2,3,4,5].reduce((acc, current)=>acc+current, 0)
const arrSum = arr.reduce((a,b) => a + b, 0);
[1,2,3,4,5].reduce((acc, current)=>acc+current, 0)