var currying = function(fn){
var arg = [].slice.call(arguments,1);//获得除了fn之外的参数。return function(){//返回一个函数var newArgs = arg.concat([].slice.call(arguments));//把旧参数和新参数放在一起 。fn.apply(null,newArgs);//使用所有参数}}; var sayHi = function(){ var args = [].slice.call(arguments);console.log(args.join(","))};var say = currying(sayHi,'hi');
say('hey','ha','hehe');