2010-09-01 36 views

回答

4

使用oop模块提供的bind method进行卷曲。

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

谢谢,Y.bind似乎是要走的路。我有我自己的实现,但使用它肯定更好。 – rogeliorv 2010-09-13 20:24:19