A horrifying `globalThis` polyfill in universal JavaScript

1 · Mathias Bynens · April 15, 2019, 2:40 p.m.
The globalThis proposal introduces a unified mechanism to access the so-called “global object” a.k.a. “the global” in any JavaScript environment. It sounds like a simple thing to polyfill, but it turns out it’s pretty hard to get right....