+ 2
How does this code looks in a simple way?
const add = a => b => a + b;
3 Réponses
+ 5
It is simply a function called currying in js
const add = (a, b) => a + b
+ 2
Your add function is returning a function
https://code.sololearn.com/ckPsb2cKIZ8F/?ref=app
To use it, you'll need to pass the parameters separately with two separate pairs of parenthesis.
+ 1
Thanks a lot