❗lexical environment optimizaton
🚧 under construction
JS ⟩ concepts ⟩ scope ⟩ lexical environment ⟩ JS engine optimization
in theory while a function is alive, all outer variables are also retained.
but in practice, JS engines try to optimize that, if they find that an outer variable is not used – it is removed.
An important side effect in v8 (Chrome, Edge, Opera) is that such variable will become unavailable in debugging.
Last updated