1

YUI3 库有柯里化功能吗?

4

1 回答 1

4

Currying 是使用oop 模块提供的bind 方法完成的。

var add3 = Y.bind(function (a, b) { return a + b; }, null, 3);
console.log(add3(39)); // prints 42
于 2010-09-11T21:18:47.540 回答