What is the ‘global’ object in NodeJS
Value of this in a node module: this in NodeJS global scope is the current module.exports object, not the global object. This is different from a browser where the global scope is the global window object. Consider the following code executed in Node: console.log(this); // logs {} module.exports.foo = 5; console.log(this); // log { foo:5 … Read more