javascript
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
javascript [2008/05/24 17:38] – removed ach | javascript [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, | ||
+ | return function() { | ||
+ | return fnc.apply(this, | ||
+ | } | ||
+ | } | ||
+ | </ |