E0173: cannot assign to loop variable in for of/in loop
There are three kinds of for
loops: C-style for
loops (;
), for
-in
loops, and for
-of
loops. It is a syntax error to write a for
-in
or
for
-of
loop which declares a variable with const
or let
and initializes
the variable:
To fix this error, declare the variable outside the for
-in
or for
-of
loop with let
:
Introduced in quick-lint-js version 0.4.0.