4 ms·
Leaving it at one line, but just naming it something more explanatory than `__magic__` would also improve it slightly (without needing an extra var declaration)
by lucideer 8y ago
Leaving it at one line, but just naming it something more explanatory than `__magic__` would also improve it slightly (without needing an extra var declaration).
`__getValueOfThis__` is good. Something like `__globalThisGetter__` or `__globalThisPolyfillGetter__` might be even clearer given the deletion line. e.g.:
__globalThisPolyfillGetter__.globalThis = __globalThisPolyfillGetter__;
delete Object.prototype.__globalThisPolyfillGetter__;
- IgorPartola 8y ago__getGlobal__()
- lucideer 8y agoMaybe. But as the article discusses, globalThis !== global