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.

3
  • It is not true - closures at block levels are possible. An example is let introduced in JavaScript 1.7 (see more here). From the documentation: "The let statement provides a way to associate values with variables within the scope of a block, without affecting the values of like-named variables outside the block.". Commented Jan 23, 2012 at 4:38
  • @Tadeck: I'm sure @Borealid is talking about JavaScript in the sense of the official ECMAScript standard. let is not part of that standard. Commented Jan 23, 2012 at 4:42
  • @amnotiam: correct. I'm sure at least one of the two different block-scoping constructs will make it into ECMAScript at some point, but that hasn't happened yet. Commented Jan 23, 2012 at 4:51