User Tools

Site Tools


javascript

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
javascript [2008/05/24 17:38] – removed achjavascript [2009/10/15 12:24] (current) – created andi
Line 1: Line 1:
 +====== JavaScript Snippets ======
  
 +Fixing the variable scope in looped closure constructs
 +
 +<code javascript>
 +function fix (fnc) {
 +    var args = Array.prototype.slice.call(arguments, 1);
 +    return function() {
 +        return fnc.apply(this, args);
 +    }
 +}
 +</code>