I actually wonder how useful block scoping really is.
I think most problems that people have with var can be solve by being explicit when declaring the variable and using unique names.
var
This ^
If you have the same variable name in your nested blocks, then likely you are also fudging up the readability, a lot, in my experience.
Which is usually where other problems start...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I actually wonder how useful block scoping really is.
I think most problems that people have with
var
can be solve by being explicit when declaring the variable and using unique names.This ^
If you have the same variable name in your nested blocks, then likely you are also fudging up the readability, a lot, in my experience.
Which is usually where other problems start...