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?
source
share