Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • This is the infamous closure problem. Javascritp does not have block scope. Commented May 29, 2013 at 0:31
  • I see. Any suggestions on an alternate approach? Commented May 29, 2013 at 0:32
  • Wrap the callback in a function that creates a closure around its parameter. Commented May 29, 2013 at 0:33
  • lostechies.com/derickbailey/2011/12/04/… Commented May 29, 2013 at 0:33
  • Okay, I'm trying to wrap my mind around this. In general, am I thinking about things in the wrong way? Is this something that is common when using Node and JavaScript? Commented May 29, 2013 at 0:54