rogeliorv
rogeliorv

Reputation: 121

Currying in YUI3 library

Does YUI3 library have currying functionality ?

Upvotes: 1

Views: 241

Answers (1)

lawnsea
lawnsea

Reputation: 6581

Currying is done using the bind method provided by the oop module.

var add3 = Y.bind(function (a, b) { return a + b; }, null, 3);
console.log(add3(39)); // prints 42

Upvotes: 4

Related Questions