You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And hence you can use these params in your function and the module.exports gets returned. also the same reason why any variable that is created in this file is not global. since it in inside a function.
To create a global values, you can add it to global object (but you shouldn't, that's the whole intention )
global.name = 'Kota';
Example: the process, buffer, setTimeInterval, clearInterval, etc... are all part of this global object and that's why you can use it directly. In actual it is process is same as global.process. You can know this by printing the global console.dir(global, { depth:0 })