โ—scopes matter with closures

JS โŸฉ value โŸฉ function โŸฉ closure โŸฉ scopes matter

it matters from which scope your closure closes over variables.

the scoping effect of the initialization block can be understood as if the declaration happens within the loop body, but just happens to be accessible within the condition and update parts.

๐Ÿ“˜ MDN

Last updated