Created
February 24, 2017 00:57
-
-
Save clinyong/6f617da71c224a74950124f942ec298e to your computer and use it in GitHub Desktop.
将传入的参数转成数组
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Thunk = function(fn){ | |
return function (){ | |
var args = Array.prototype.slice.call(arguments); | |
return function (callback){ | |
args.push(callback); | |
return fn.apply(this, args); | |
} | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment