3 ms·
Right, I understand why. And, if I have two in the same scope, jshint will rightly alert me that I have an error. But I don't have this issue once in ~20k lines
by nfriedly 14y ago
Right, I understand why. And, if I have two in the same scope, jshint will rightly alert me that I have an error. But I don't have this issue once in ~20k lines of js. So in my case, jslint not honoring its own -vars option was just a nuisance.
And while I agree that declaring vars at the top is closer to whats actually happening, I disagree that it makes it easier to comprehend.
- ahoge 14y agofunction foo () { x = 5; // totally fine ... var x; // because we declare it here }