开发者

Currying in YUI3 library

开发者 https://www.devze.com 2023-01-14 23:59 出处:网络
Does YU开发者_开发技巧I3 library have currying functionality ?Currying is done using the bind method provided by the oop module.

Does YU开发者_开发技巧I3 library have currying functionality ?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消