Globalscope (GL05)
1: var globalVar = "I'm global!";
2: let globalLet = "Also global (let)";
3: const globalConst = "Global const";
4:
5: import * as myModule from './GL%2301.js'; // ES Modules import
6:
7: console.log(myModule.globalVar); // undefined
8: console.log(myModule.globalLet); // undefined
9: console.log(myModule.globalConst); // undefined
Modules and Scope (Node.js): Each module in Node.js (whether using CommonJS or ES Modules) has its own scope. I'm global! Also global (let) Global const undefined undefined undefined ReferenceError: window is not defined
Globalscope context:
ES6 context:
- (2024) Notes about JS Closures. #ES6
- (2024) Notes about Javascript asynchronous programming. #ES6
- (2022) Modern Javascript books #ES6 #Doc
- (2021) JS learning start point #ES6
- (2021) Maximilian Schwarzmüller Javascript lecture #ES6
- (2021) Javascript interview question from Happy Rawat #ES6
- (2021) Javascript tests #ES6
- (2016) New unique features of Javascript (updated). #ES6
Comments (
)

Link to this page:
http://www.vb-net.com/JavascriptES6/GL05.htm
|