Mastering Scopes and Closures in JavaScript
A for loop with setTimeout gives different answers with var and with let. Scope and closures explain why. I walk through each case so the behaviour stops feeling like magic.
Read the full post on Medium.