Skip to content

Instantly share code, notes, and snippets.

@CrypticSwarm
Created September 14, 2010 21:46
Show Gist options
  • Save CrypticSwarm/579838 to your computer and use it in GitHub Desktop.
Save CrypticSwarm/579838 to your computer and use it in GitHub Desktop.
Function.prototype.ac = (function(){
return ac;
function ac(len, bind, args){
var func = this
, args = args || [];
return function internal(){
args = args.concat(Array.prototype.slice.call(arguments));
len -= arguments.length;
if (len > 0) return internal;
else func.apply(bind, args);
};
};
})();
(function(a, b, c, d){
console.log(a + b + c + d);
}).ac(4)(1)(2)(3)(4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment