DEV Community

loading...

Discussion on: Enough JavaScript to get you Started : #17 rest,spread and destructuring

Collapse
larsonnn profile image
Lars Feldeisen • Edited

You could also write your sum function like that:

const sum = (...el) => el.reduce((a, c) => a + c);
Enter fullscreen mode Exit fullscreen mode
Collapse
whoadarshpandya profile image
Adarsh Pandya Author

Nice idea ! reduce, map and bind are being written in upcoming article :)