the.bay.news

Why Your JavaScript Loop Logs the Same Value Every Time (And How to Fix It)

DEV Community
Why Your JavaScript Loop Logs the Same Value Every Time (And How to Fix It)
It looks like a timing bug in setTimeout. It isn't. It's var's scope rules doing exactly what they're designed to do — and the fix is one keyword, once you know why.

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.