News for hackers. Stuff that matters.
Re:Fogus: Node.js should become its own language by Cushman on Tuesday April 12, 2011 @10:13AM (#2437255)
For the record, you can also create scope without a closure using with (or let, if it's available.)

  for (var i = 1; i < 10; ++i)
  {
    with({i:i}) // let (i=i)
    {
       setTimeout( function( ) { alert( i ) }, i * 250 );
    }
  }
will do what you intend. If let is available, for (let i = 1; etc. will do the same thing without the cruft.

There are no comments on this comment yet.