global


在浏览器中,顶层的作用域是全局作用域。这意味着在浏览器中,var something 将定义新的全局变量。在 Node.js 中这是不同的。顶层作用域不是全局作用域;Node.js 模块内的 var something 将是该模块的本地。

¥In browsers, the top-level scope is the global scope. This means that within the browser var something will define a new global variable. In Node.js this is different. The top-level scope is not the global scope; var something inside a Node.js module will be local to that module.