Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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__;


__getGlobal__()


Maybe. But as the article discusses, globalThis !== global




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: