How to declare an iterator for loop variable that passes JSLint.com validation.
I have tried var, let, and neither work. I simplified my script down to this line. JSlint.com will not progress past this warning. Have googled it and tried every combination of for loops I can thing of. I have enabled allowing for loops, and read the JSlint nazi help guide.
/*jslint
for
*/
function test() {
"use strict";
for (let i = 0; i < 5; i += 1) {
console.log(i);
}
}
JSLint.com flags:
Unexpected 'let'.
for (let i = 0; i < 5; i += 1) {
This is not an unused variable problem. To prove it, I changed it to console log i, the only variable, it gives the same error, whether in strict mode or not.JSLint does support ES6