Getting a reference to the global object in an unknown environment in strict mode

In ES5, you can get a reference to global object from within strict mode via indirect eval call:

"use strict";
var global = (1,eval)('this');

Take a look at my article; particularly at this section on strict mode.

Leave a Comment