On the browser the global object is window object
, and in nodejs
the global object is global object
.
when I run this code using nodejs
on the terminal i had this output
console.log(this === global)
===> this return false
And then using the interactive mode of nodejs
>this === global
true
But on the browser both console.log
and this === window
returns true
What is the difference?