DEV Community

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

Collapse
 
_genjudev profile image
Larson • 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

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