Javascript globalThis Property

Javascript Update

The globalThis property refers to the global object regardless of the Javascript platform.

Historically each platform has its own way to access the global object. In the browser window refers to the global object, in Web Workers it is referred by self, while in Node.js it is referred through global.

With globalThis property, we have the same identifier name regardless of the Javascript environment. This increases code portability across platforms.

Browser Compatibility

Tutorials & Resources

March 16, 2020

Comments

Loading Comments