Closed ExE-Boss closed 5 years ago
Thanks for your feedback!
global
is not web-compatible, in Scripts or Modules, because it's used as environment detection (to distinguish node
and browsers). Please see the list of constraints for more information: https://github.com/tc39/proposal-global/blob/master/NAMING.md
I still prefer, and will keep using, global
over globalThis
.
The main reasoning is that
this
is very confusing in the context of JavaScript due to it being a horrible mess that was originally created by a single developer for Netscape Navigator.See also https://github.com/tc39/proposal-global/issues/31 for more reasoning.
(I really, really hate the name
globalThis
, even more than usingwindow
and I much prefer the technological purity of plainglobal
)At the very least, I would want
global
to be supported in modules by default.Because of the above, I tend to do:
Then, I just use
global
as alias ofwindow
.