3 ms·
What if I specifid the `global` scope, like `global.SOME_VAR`? Will that skip the expensive search of the parent nodes?
by aforty 9y ago
What if I specifid the `global` scope, like `global.SOME_VAR`? Will that skip the expensive search of the parent nodes?
- Sawamara 9y agoIt cannot. It still has to check whether there is a local variable in any other scope that is above the one currently being executed, all the way to the top where it finds global. Same with window in a browser context. You could still have a "window" variable placed between your execution context and the global context.