[Javascript] Get Global This
const getGlobalThis = () => { if (typeof self !== 'undefined') return self if (typeof window !== 'undefined') return window if (typeof global !== 'undefined') return global if (typeof this !== 'undefined') return this throw new Error('Unable to locate global object') }