mul(a)(b)(c)
Difficulty: easy
Implement mul(a)(b)(c), a fixed-length curried multiplication function.
Each call receives one number and returns the next function until all three numbers are available. The third call returns the product.
Difficulty: easy
Implement mul(a)(b)(c), a fixed-length curried multiplication function.
Each call receives one number and returns the next function until all three numbers are available. The third call returns the product.
It returns nested functions so callers can supply arguments one at a time via closures, e.g. mul(2)(3)(4).
Infinite currying, converting curry to partial application, and explaining when currying helps API design.
Currying sum, memoize, and debounce/throttle.