Closures Inside Loops; Be Careful Enough [RE#2] Closures could sometimes be tricky to the point that you may find out things too late/costly. Look at this code fragment: let a = [1, 2, 3]; let fn = []; for (x of a) fn.push(() => x); for (f of fn) console.log(f()); Enter fullscreen mode Exit fullscreen…

Read More