Skip to content

Instantly share code, notes, and snippets.

@hughfdjackson
Last active December 15, 2015 08:19
Show Gist options
  • Select an option

  • Save hughfdjackson/5229834 to your computer and use it in GitHub Desktop.

Select an option

Save hughfdjackson/5229834 to your computer and use it in GitHub Desktop.
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