'Global' object in node.js

前端 未结 4 2141
难免孤独
难免孤独 2020-12-06 03:05

I am using 0.3.1-pre Node.js

Doing this:

typeof global.parseInt

results in

\'undefined\'

Howeve

4条回答
  •  清歌不尽
    2020-12-06 03:50

    Apparently, the global object isn't the global object as window is in the browser. It's (according to micheil in #nodejs @ freenode) really only used internally. Something about global closures and whatnot.

    parseInt and setTimeout and all those buddies are globals on their own. Not part of any visible global object.

提交回复
热议问题