Created
September 14, 2010 21:46
-
-
Save CrypticSwarm/579838 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
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