Joined May 2015
·

Crates

Lead Front-end Developer at Gartner, Inc.
·
Stamford, Connecticut, USA
·
·
·

Posted to Be careful with setTimeout in loops over 1 year ago

I'd say you're half-right, but adding a proper closure and applying the context or arguments would be a bit cleaner.

Check out this SO post for details:
http://stackoverflow.com/questions/1728563/changing-the-scope-of-an-anonymous-function-on-a-settimeout-causes-a-weird-warni

Achievements
1 Karma
0 Total ProTip Views