Inspectopedia Help

Indexed 'for' is used instead of 'for..of'

Reports an indexed <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for">for</a> loop used on an array. Suggests replacing it with a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of">for..of</a> loop.

for..of loops are introduced in ECMAScript 6 and iterate over iterable objects.

Last modified: 29 April 2024