abergquist (181) [Avatar] Offline
#1
WRT p. 58 (p. 62 of the .PDF), I read the following:

In node.js, the aptly-named global object global, is available to you in every program you run.


But then Listing 3.2 reads as follows:

Listing 3.2 Discovering global objects
// `This` will refer to the global object
console.log(Object.keys(this)); ?
// How many keys are there on the global object?
console.log(Object.keys(window).length)
// in node.js
console.log(Object.keys(global).length)
? Object.keys() will return an object's own enumerable properties as an array. Using this on this will let you see all
of the properties that exist on the global object but aren’t directly visible to you.


As a reader, this makes me ask: is the global object called "global" or is it called "Object"? That is the question!
mark (41) [Avatar] Offline
#2
Will def. clear this up — thanks for posting! smilie