Re:JavaScript Quiz Set
by bolshchikov on Sunday January 20, 2013 @02:03AM
(#5086254)
Global variables are in fact properties of the global object. In web pages the global object is window, so you can set and access global variables using the window.variable syntax.
https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Va...
The third question - "Global Variables Intro" in the "beginner" (one by http://madebyknight.com/javascript-scope/) is not quite right.
is not the same as Whenever you don't declare a variable with a var, it does not become a global variable, rather, it becomes a property of the global (or host) object.The main difference here is that you can delete a property -
But you can't delete 'a' if it were defined by var.In the same light, the following statement (IMO) is incorrect.
Still working through the tutorial ...Edit - Copy pasted the wrong sentence from the quiz. Sorry