Last active
December 15, 2015 08:19
-
-
Save hughfdjackson/5229834 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 bind = function(fn){ | |
| var args = [].slice.call(arguments, 1) | |
| return function(){ | |
| var args2 = [].slice.call(arguments) | |
| return fn.apply(this, args.concat(args2)) | |
| } | |
| }; | |
| bind(function(a, b, c){ return a + b + c }, 1, 2)(3) //= 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment