Another post here explains that "Node wraps module's code into a function", and gave an explanation "https://nodejs.org/api/modules.html#modules_the_module_wrapper"
But I am still confused, I have following snippet:
var n = 'my'
module.a='k'
console.log(module.a);
console.log(module.n);
Using nodejs, it prints out
k
undefined
Question: if script level variables like 'n' is binded to function scope of nodejs "module", why 'module.n' doesn't exist?
Thanks.