Global and Local and Private Functions (Javascript)
I am currently reading a book on Javascript by Pragmatic, and I'm confused about one thing. They have a section on how to make variables global, local, or private. What is the difference between local and private variables? Is there one? How does one make a variable global or local, They said something about putting 'var =' before it, but it was very vague. Raynos None, People use "private" because they are mistaken and are meant to say "local" local variables are defined as var foo = "local"; global variables are a properties of the global scope object (which is window in the browser) window