Till now I was expecting that there in no block level scope in Javascript. But after reading this article I came to know that block-scoped variables are introduced in javascript. Although this article <Everything you need to know about Javascript variable scope > has a very good explaination about the javascript variable scope, I am still wondering the list of browsers and their versions where we can start using block-scoped variables.
It would be great if you could add to the information about block-scope variable in javascript.

3 Years
Discussion Span
Last Post by evaipar

came to know that block-scoped variables are introduced in javascript

If they have just been introduced sounds like you could be playing a game of Russian Roulette with your internet browsers.

Better to be safe and ignore them.

Or use jquery.


As I understand it, the ECMAScript that is the backbone of JavaScript is pretty standard among most major browsers. The type of scoping youre talking about should be pretty consistent from IE8+ (probably IE6 and 7), as well as all other flavors you will encounter.

The only way you will know for sure if you are having issues is to come across them. For the most part, Mozilla has been good about providing shims to "fix" broken code in older browsers, so when you come across something "broken" just google it and you will most likely find your solution.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.