2 ms·
Not necessarily the _top_ level if you are referring to scope. `this` will be the default global unless another context is defined, whether you are at the top l
by singlow 11y ago
Not necessarily the _top_ level if you are referring to scope. `this` will be the default global unless another context is defined, whether you are at the top level or inside a function.
In node, there is a name for the default global: "global", which is also the default context. So node gives it a "generic substitute" as the OP suggested. Most people use "this" to make assignments to it, rather than the "global" name, since it is usually accessed from the default context.