Implement a function curry(fn) that transforms a function taking multiple arguments into a function that can be called repeatedly with any number of arguments until all required arguments are provided.
The function should:
fn with a fixed number of parameters.Example
function sum(a, b, c) { return a + b + c; } const curriedSum = curry(sum); curriedSum(1)(2)(3); // 6 curriedSum(1, 2)(3); // 6 curriedSum(1)(2, 3); // 6
JavaScript Function
No test results yet
Click "Run" to execute tests