Implement Basic Function Currying with Fixed Arity

Write a curry() function that transforms a regular multi-argument function into a series of single-argument functions. For example, curry(add)(1)(2)(3) should equal add(1, 2, 3). The curried function should collect arguments one at a time and invoke the original function only when all expected arguments (based on fn.length) have been provided. This is the entry point to mastering functional programming and is asked in nearly every FP-focused interview.

Examples
Input: []
Output:
Hints

Implement Basic Function Currying with Fixed Arity

Write a curry() function that transforms a regular multi-argument function into a series of single-argument functions. For example, curry(add)(1)(2)(3) should equal add(1, 2, 3). The curried function should collect arguments one at a time and invoke the original function only when all expected arguments (based on fn.length) have been provided. This is the entry point to mastering functional programming and is asked in nearly every FP-focused interview.