Node js window object

In the browser, the global object window object, and in the nodejsglobal object - global object.

when I run this code using nodejson terminal i, this output

console.log(this === global) ===> this return false

And then using nodejs interactive mode

>this === global

true

But in both of the browser console.logand this === windowreturntrue

What is the difference?

+4
source share
1 answer

I can give you part of the answer :

. , , var - . Node . ; var - Node .

https://nodejs.org/api/globals.html#globals_global

, .

+2

All Articles