Take the 2-minute tour ×  Having coded JavaScript since 1996, I
have a very simple issue which I could not clearly
prove/disprove using jsfiddle  In some JS attached to a CV I
spotted some issues that I would like to verify - one of which
is multiple declaration of variable in the same function
Testing it seems it is allowed in newer browsers (OSX Chrome16
Fx 10beta) - as far as I remember it used to give errors
(Netscape/Mozilla/Fx1/IE5 or so) :  function something() {   var
var1 = ""; /* reams of code which scrolls the first declaration
off the screen     so the author likely forgot the var was
already declared earlier     in the same function */   var var1
= ""; // could this result in an error in some browsers?  My
fiddle is here  share|improve this question add comment  3
Answers  up vote 3 down vote accepted  Not as far as I'm aware,
I've seen javascript functions with multiple for loops each
declaring their own var i for at least 6 years all without
issue.  Having looked at the spec, there seems to be