The Classic Bug
The classic: for (var i = 0; i < 5; i++) { setTimeout(() => console.log(i), 100); } logs 5 five times, not 0 1 2 3 4. Because var is function-scoped, all five callbacks share the same i variable, which is 5 by the time any of them run.