(ES6) ES6 (2016)

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:



Comments ( )
<00>  <01>  <02>  <03>  <04>  <05>  <06>  <07>  <08>  <09>  <10>  <11>  <12>  <13>  <14>  <15>  <16>  <17>  <18>  <19>  <20>  <21>  <22>  <23>  <24>  <25
Link to this page: http://www.vb-net.com/JavascriptES6/GL05.htm
<TAGS>  <ARTICLES>  <FRONT>  <CORE>  <MVC>  <ASP>  <NET>  <DATA>  <TASK>  <XML>  <KIOSK>  <NOTES>  <SQL>  <LINUX>  <MONO>  <FREEWARE>  <DOCS> <TRAVELS> <FLOWERS> <RESUME> < THANKS ME>