Variable scope in JavaScript
Wednesday, November 14th, 2007Here’s a very nice summary of the scope of variables in JavaScript, i.e. where in your script they’re availalbe. An important point that I needed for a script: If you need to declare a variable inside a function but need its scope to be global, omit the var keyword.