Hi,
is there any chance to have an additional option implemented?
Let's have a look at the following code:
function foo(){
"use strict";
var a = [];
for (var i=0;i<10;i++) { }
var a = [];
for (var i = 0; i<10; i++) { }
}
Two warnings are coming up:
1.) "a is already defined"
2.) "i is already defined"
Is there any chance to get an option that treats var-declarations with "blockscope", like in Java or C#?
IMO, the duplicate declaration of "i" is perfectly fine and even good coding style. Moving the index-variables to the top of methods would just reduce readability without gaining anything.
I know the details about variable declaration in javascript, but that does not mean that I like them :-)
Any chance, this might get implemented?
Regards
Andreas