One Pager Cheat Sheet

  • Currying is a transformation of functions that translates a function from callable asf(a, b, c)into a sequence of callable functions asf(a)(b)(c), which helps to avoid passing the same variable multiple times and create higher order functions.
  • We are creating a function called curry that will return another function, curriedFunc, that will either spread the arguments provided or recursively call itself, depending on the case.

This is our final solution.

To visualize the solution and step through the below code, click Visualize the Solution on the right-side menu or the VISUALIZE button in Interactive Mode.

JAVASCRIPT

Alright, well done! Try another walk-through.

If you had any problems with this tutorial, check out the main forum thread here.