3 ms·
You can not use partial application with that. for example const add = x=>y=>x+y can be partialy applied like the following const add3 = add(3) // this is also
by ponkin 9y ago
You can not use partial application with that.
for example
const add = x=>y=>x+y
can be partialy applied like the following
const add3 = add(3) // this is also a function
- masklinn 9y ago> You can not use partial application with that. You can: const add3 = add.bind(null, 3)
- a-saleh 9y agoI still like currying better, but I just might be weird like that :-)
- masklinn 9y agoI only asserted that you could partially apply regular functions. But I don't think currying looks or feels nice in Javascript. Proper curried languages are definitely better suited for partial application though.
- mwilliaams 9y agoYou could use default parameters in this case. const add = (a, b=0) => {return a+b}