Thus, I saw a function that was absolutely frankly beautiful in its simplicity, since it allowed you to find a global object (which, depending on the environment at that time, could not be a window), while inside an anonymous function; however, when you throw javascripts "use strict"; mode crashes due to a change in the 'this' keyword. There were several ways to do this?
(function () { var win = function () { return (function () { return this; }()); };
Now, if they are called in the context of "use strict", we lose the described functionality, is there any equivalent that can be done in ES5 strict mode?
For reference
(function () { "use strict"
Akidi
source share