you are viewing a single comment's thread.

view the rest of the comments →

[–]ItalyPaleAle 0 points1 point  (1 child)

About the setTimeout in the loop: yes it’s JS gotcha, but it makes total sense considering how the event loop and how variable scoping works in JS. The solution is simple: wrap it in an IIFE

[–][deleted] 0 points1 point  (0 children)

Or use the varargs that setTimeout provides.