You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make automatic refactoring between for...of and forEach in JavaScript #28
I was transitioning a lot of "for...of" cycles into forEach cycles to implement IE12 support. And it is very easy from automatic point of view. So if you implement this transition (forward and backward) as an automatic option on Alt+Enter, it would be good.
Activity
unv-unv commentedon Jun 17, 2020
Though I need to say that not every forEach may be translated to "for...of". There may be additional parameters in forEach function:
https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
Still, there may be a more complex transition:
for (const [index, value] of array.entries()) { ... }array.forEach(function (value, index) { ... }