Google V8 runtime by default is not run in strict mode.
The Function.apply
method when run in strict mode returns the global context, so we can test with the given code.
- Execute testStrict()
- Check the Logs where
__g__
is not null
The Google AppsScripts runtime is run in non-strict mode, and we can get access to global scope via this method.
I was under the impression that ES6 was run in strict mode; I was mistaken. It's ES6 modules that are run in strict mode.