If w3schools really says that (heaven helps us, it is), it is simply wrong, which is easy to prove with a simple experiment.
When you load a web page, the global JavaScript environment on this page is fresh. No global tables from the previous page in the same window are available for the new page. Obviously, some other functions provided by the browser (for example, things stored in the web storage) may be, but not global.
Although this has improved slightly over time, unfortunately, this is not the first simple factual error that people noted in w3schools. I would suggest instead of the MDN documentation . While MDN is edited by the community and, therefore, sometimes has a random inaccuracy, itโs pretty good in all of this, and any inaccuracies that one user adds are usually fixed quite quickly by others.
In the comment you asked:
What is the official JavaScript documentation page?
The only official documentation for JavaScript is the specification . Similarly, browser features such as the DOM are also described in various specifications . The WHAT-WG " HTML5 standard " (which is much more than HTML) also documents HTML (obviously) and a wide range of other browsers functions. Others are in their own specifications. One of the great things about MDN is that it refers to specifications.
source share