Multiplier via Closure

Closures ยท medium

Implement `multiplyWith(factor, n)` that uses a closure internally: create a function that multiplies by `factor`, then apply it to `n` and return the result.

Hints
  • Define an inner function that closes over `factor`.
  • Call that inner function with `n` and return the result.

Learning resources

Loading...

Run your code to see results.