js array add every element of array

Solutions on MaxInterview for js array add every element of array by the best coders in the world

showing results for - "js array add every element of array"
Emma
24 May 2017
1var array = ['a', 'b', 'c'],
2    result = array.reduce((r, a) => r.concat(a, 0), [0]);
3    
4console.log(result);