DEV Community

Discussion on: why you shouldn't use arrow functions?

Collapse
 
baenencalin profile image
Calin Baenen

Actually, you said arrow functions don't have arguments.
That is false.

const add = (...nums) => {let i = 0; for(let num of nums) i += num; return i;}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
blessinghirwa profile image
Blessing Hirwa

You can read it from here:
developer.mozilla.org/en-US/docs/W...

Collapse
 
baenencalin profile image
Calin Baenen

Oh, you meant the keyword (you should probably specify that in the post).

Thread Thread
 
blessinghirwa profile image
Blessing Hirwa

Yeah, I just added it now.