I'm very much new to JavaScript. This question may be something very primitive. The posts that are suggested when I was typing this question didn't help me to resolve the issue.
I was following a tutorial and it uses Google Chrome console for exercises. It showed that the global and window objects tables could be printed on the console.
I tried and window was printed but not the global object. Why is this? Do I need to upgrade to a certain version of chrome/install other plugin to support global variables?
It says "Global is not defined"
What do you mean by global variables? If you define a variable "var x = 0" Outside of any functions it's global and can be called anywhere.
Including in the console.
Have you perhaps run across a NodeJS tutorial where global
is used to create a global variable outside of a module?
https://nodejs.org/api/globals.html#globals_global
This is not valid in browser JavaScript, even though in NodeJS it is still JavaScript, the global stuff is a little different.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.