User Tools

Site Tools


javascript

JavaScript Snippets

Fixing the variable scope in looped closure constructs

function fix (fnc) {
    var args = Array.prototype.slice.call(arguments, 1);
    return function() {
        return fnc.apply(this, args);
    }
}
javascript.txt · Last modified: 2009/10/15 14:24 by andi