JS ⟩ concepts ⟩ scope ⟩ top-level
top-level scope relative to a JS file.
in Node.js:module scope ( top-level this === module.exports)
module.exports
in browser:
script mode: global scope.
module mode: module scope
global variables don't get created by declaring variables in the top-level scope of a module (module scope).
What is the 'global' object in NodeJSarrow-up-right
Meaning of "this" in node.js modules and functionsarrow-up-right
Node.js ⟩ "global"arrow-up-right ⭐️
Last updated 3 years ago