大熊君大话NodeJS之------Global Objects全局对象
一,开篇分析 在上个章节中我们学习了NodeJS的基础理论知识,对于这些理论知识来说理解是至关重要的,在后续的章节中,我们会对照着官方文档逐步学习里面的各部分模块,好了该是本文主角登台亮相的时候了, Global 让我们来看一下官方的定义: Global Objects全局对象 These objects are available in all modules. Some of these objects aren't actually in the global scope but in the module scope - this will be noted. 这些对象在所有的模块中都可用。实际上有些对象并不在全局作用域范围中,但是在它的模块作用域中------这些会标识出来的。 In browsers, the top-level scope is the global scope. That means that in browsers if you're in the global scope var something will define a global variable. In Node this is different. The top-level scope is not the global scope; var something inside a