Friday, January 10, 2020

Variable shadowing in JavaScript.

What is globalThis? #javascript, #es2020, #globalThis

A new property added in es2020 called globalThis. It's cross-platform support to access to the global object in JavaScript. Accessing the global property in JavaScript has always posed some difficulty. This is because different platforms have different ways to access it. such as Client side uses: windows,frames,this web workers uses: self node js uses: global now all environment can use simple globalThis . Also you can watch my video on this topic.