Challenge: Let's Curry!
This challenge will test your skills in implementing currying functions in JavaScript.
We'll cover the following
Problem statement #
Write a wrapper function currying
which accepts a function, say func
, and returns the curried version of func
.
Input #
Function to be transformed to the currying function
Output #
Curried Function
Sample input #
function multiply(a, b, c) {
return a*b*c;
}
Sample output #
let curried = currying(multiply);
curried(2)(3)(4) //24
curried(2,3)(4) //24
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.