DEV Community

Discussion on: Daily Challenge #50 - Number Neighbor

Collapse
 
jasman7799 profile image
Jarod Smith

Hey thanks for the response I will look at regexes next time for this kind of problem. Also I thought currying was supported in ES6?
via

const f = a => b=> a + b
Thread Thread
 
aminnairi profile image
Amin

What you did is indeed currying but it is not transparent in the sense that if you want to pass all three arguments at once you will have to make three calls. The curry implementation allows you to either pass all arguments at once like a regular function call or partially calling the function. I kinda dislike calling my function multiple times and the only two reasons are aesthetic and the fact that it is less natural to define functions like that but arrow functions syntax makes it a little bit cleaner.