3 ms·
Access to global object was intentionally restricted in strict mode and modules and now you (JS devs) want it back. That's not what rational people do.
by codedokode 7y ago
Access to global object was intentionally restricted in strict mode and modules and now you (JS devs) want it back. That's not what rational people do.
- realityking 7y agoAccess to the global object is not at all restricted in strict mode. The changes in strict mode related to the global object are: - can’t define implicit global variables (you need to be explicit) - “this” doesn’t refer to the global object The problem is that different host environment have different names for the global object. That’s what make it hard to write code that works independent of the host environment and that’s what globalThis is aiming to fix.