Currying in javascript for function with n parameters
<p>If f :: (a, b) -> c, we can define curry(f) as below:</p>

<p>curry(f) :: ((a, b) -> c) -> a -> b -> c</p>

<pre><code>const curry = f =&gt; a =&gt; b =&gt; f(a, b);
const sum = curry((num1, num2) =&gt; num1 + num2);
console.log(sum(2)(3)); //5
</code></pre>

<p>How do we implement generic curry function that takes a function with n parameters?</p>