js闭包列子
?
<html> <head> <title>js learn</title> <script type="text/javascript"> var curry = function (f) { alert("1111"); return function(a){ alert("2222"); return function(b){ alert("333"); return f(a,b); } } } function cf(a,b){ alert("00"); alert(a); alert(b); } var a1 = curry(cf); alert("----"); var b1 = a1("xxx"); alert("----"); b1("yyy"); </script> </head> <body> </body> </html>
?