javascript
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
javascript [2008/05/24 11:53] – created 81.202.250.157 | 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, | ||
+ | } | ||
+ | } | ||
+ | </ |