Skip to content
Advertisement

How to convert for of loop into a for loop to solve the ESLint error

How do I convert a for of loop into a for loop? This is so that I can avoid/ solve the eslint error message.I have tried googling, but the solution I am getting is to disable/configure eslint. Help me understand what I’m missing. here is the error message. ” error iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations “

here is my working code using the for of.

JavaScript

here is my failed implementation of the for loop.

JavaScript

Advertisement

Answer

JavaScript

Better way

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement