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.

More JS Coding

View all JS Coding →
JS CodingMedium

5. Throttle

JS CodingMedium

13. Deep Clone

JS CodingMedium

14. Event Emitter

JS CodingEasy

66. Promise Methods

JS CodingEasy

19. Memoize I

JS CodingMedium

86. API Retry

Related hubs

  • All JavaScript coding
  • JavaScript interview questions
  • JS polyfill interview questions
  • Debounce & throttle questions
  • React interview hub

FAQ

How is currying-mul different from a normal multiply function?

It returns nested functions so callers can supply arguments one at a time via closures, e.g. mul(2)(3)(4).

What follow-ups are common?

Infinite currying, converting curry to partial application, and explaining when currying helps API design.

Related practice?

Currying sum, memoize, and debounce/throttle.