2 Matching Annotations
- Nov 2020
-
stackoverflow.com stackoverflow.com
-
this in NodeJS global scope is the current module.exports object, not the global object
-
If you want a reference to the global object that works in any context, you can read this from a directly-called function. const global = (function() {return this})();. This evaluates to window in the browser, self in a service worker and global in nodejs.
-