Me talking about random stuff. Mostly for future reference.
Tuesday, April 29, 2008
Poor man's let statement
So we've all read how javascript 1.8 (and ecmascript 2) has let statements, but until our favorite browser gets there, here's how I work around the limitation:
var a = 1
new function() {
var a = 2;
alert(a);
}()
alert(a);
No comments:
Post a Comment