a loop to store the value of the loop variable
i into the closure’s
j so that we don’t just
console.log(10) 10 times.
Though this example is trivial it represents a common method for
solving closure related issues in asynchronous code.
1 2 3 4 5 6 7 8
1 2 3 4 5
from line 2 and defines it outside the loop so that it need not be
interpretted/defined 10 times - it does this optimization for us.
link at the top left of the code snippet.
Note the delay function is just a reordered