What is globalThis? ES2020 new features

twostepdeveloper

twostepdeveloper

Posted on January 10, 2020

What is globalThis? ES2020 new features

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.
https://youtu.be/yn3J6KfMqBw

💖 💪 🙅 🚩
twostepdeveloper
twostepdeveloper

Posted on January 10, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related