If I chose to curry this function:
function mult(a,b,c) {
return a * b * c;
}
into :
function mult(a) {
return function(b) {
return function(c) {
return a * b * c;
}
}
}
What is the benefit? Is it that if I know one or more of my args will be the same, this will save run memory rather than having to recalculate with them?
// 99 and 2 will be args a lot
let test = mult(99);
let test2 = test(2)
test2(42) // 8316
test2(1) // 198
and so on and so on...is that the benefit of currying?