Skip to content Skip to sidebar Skip to footer

Generalised Curry - Javascript

While reading an article on implementation of a generalised curry in Javascript, I stumbled upon this piece of code. function curry(fn) { return (...xs) => { if (xs.lengt

Solution 1:

A bound function returns a function with partially applied arguments, so f(a, b, c) becomes f.bind(null, a).bind(null, b)(c).


Post a Comment for "Generalised Curry - Javascript"