re: Daily Challenge #50 - Number Neighbor VIEW POST

re: Way to go buddy! From my perspective, to format the phone number in 3 segments, I would have used this instead of the 3 calls you made. "use str...

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?

const f = a => b=> a + b

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.

code of conduct - report abuse