DEV Community

Discussion on: 1 line of code: How to get the sum of an array of numbers

Collapse
 
frankwisniewski profile image
Frank Wisniewski

not really serious...

const sum = arr => eval(arr.join`+`)
Enter fullscreen mode Exit fullscreen mode
Collapse
 
martinkr profile image
Martin Krause

:D