I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
They've chosen a poor name there, I think. 'global' implies it's the top level, this implies it's local to whatever context you're in. Everyone should be able to access "global" scope, but other modules shouldn't see your this.
So how is globalThis a name that's going to work? It's another way Javascript is getting more confusing. Wouldn't it be better to suggest not sharing global scope at all?
They've chosen a poor name there, I think. 'global' implies it's the top level,
this
implies it's local to whatever context you're in. Everyone should be able to access "global" scope, but other modules shouldn't see yourthis
.So how is
globalThis
a name that's going to work? It's another way Javascript is getting more confusing. Wouldn't it be better to suggest not sharing global scope at all?You can read more about it here: github.com/tc39/proposal-global/is...