Some time ago, I introduced Andi to what he called »Advanced magic«:
A JavaScript function which binds another function to its parameters without actually executing it:
function bind(fnc) {
// Store passed arguments in this scope.
// Since arguments is no Array nor has an own slice method,
// we have to apply the slice method from the Array.prototype
var args = Array.prototype.slice.call(arguments, 1);
// Return a function evaluating the passed function
// with the giv…
More
Support this project and others with 1-click micro-donations
