What they don't teach you in (W3)school: JavaScript variable scoping
blog.istvan-antal.ro
blog.istvan-antal.ro
w3schools doesn't, at all, make the claims this author is stretching for. In fact, on their JS Functions page (http://w3schools.com/js/js_functions.asp), w3schools state precisely what the author illustrates:
The Lifetime of JavaScript Variables
If you declare a variable, using "var", within a function, the variable can only be accessed within that function. When you exit the function, the variable is destroyed. These variables are called local variables. You can have local variables with the same name in different functions, because each is recognized only by the function in which it is declared.
If you declare a variable outside a function, all the functions on your page can access it. The lifetime of these variables starts when they are declared, and ends when the page is closed.
There is a screenshot in the post, on your link it may be right, but on the link referenced in the post, it's wrong.