Open n-a-m-e opened 8 years ago
The for of statement is a new ES6 feature that has not yet been proven to be a good part.
Try arr.every.
Recursion is becoming a better approach than looping.
Could this perhaps be reconsidered? It's been 8 more years, and at least to me, for...of
loops did turn out to be a good part. If maintainers agree, I might implement this during the next few weeks.
I'm new to JSLint, and really I like it: it is a self-contained, dependency-free tool that just works without npm hell. The one thing I don't like is that jslint cannot parse my loops.
I think that is a good idea. We could also relax the restrictions on 'let' in scopes. Some of the JSLint rules were to get us thru some standard transitions, and I think those are way behind us now.
function stmt_for() {
let first;
let the_for = token_now;
if (!option_dict.for) {
// test_cause: // ["for", "stmt_for", "unexpected_a", "for", 1]
warn("unexpected_a", the_for);
}
check_not_top_level(the_for);
functionage.loop += 1;
advance("(");
token_now.free = true;
if (token_nxt.id === ";") {
...
Firstly thanks for writing jslint, secondly I found this new for-of loop that javascript has https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of but js lint throws the error
I could always use forEach instead but then I can't break out of the loop
what is your opinion, is the for of loop useful or should I use something else instead. Thanks