🌟global scope
(in a programming environment) the scope that contains, and is visible in, all other scopes.
global object - an object that always exists in the global scope.
globalThis - identifier for the global object.
window - global object in browser.
self - global object in web worker.
global - global object in Node.js.
isCurrentlyInGlobalScope() - check if current context is in global scope.
global scope
in browsers:global scope is top-level scope.
in Node.js:global scope is not top-level scope.
👉 Node.js ⟩ "global" ⭐️
in the global scope, var/function declarations also expose themselves as property on the global object.


Last updated
Was this helpful?