No. Currying requires each returned function to remember the previous arguments. This is only possible with closures. Without closures, the inner function would not have access to outer arguments.
Would currying work without closures in JavaScript?
More FAQs in How Currying Relies on Closures in JavaScript
Each curried function returns a new function that closes over the previous arguments. The inner function has access to all outer arguments via the closure. Without closures, currying would not work.
Closures provide the accumulated arguments (state) across calls. Each returned function remembers the previous arguments via the closure. Without closures, the inner function would not have access to outer arguments.
The returned arrow function (...next) => curried(...args, ...next) closes over args and fn. Each partial call accumulates arguments via the closure. When enough are collected, fn is called.
Still have questions?
Browse all our FAQs or reach out to our support team
Want to upskill yourself?
Your learning library
Small steps. Big possibilities.
Find your next course. Build something great.