Global and Local variables in JavaScript

by jenny on 17 December 2007 - 12:29am in

Any variable that is initialized inside a function using the var keyword will have a local scope. If a variable is initialized inside a function without var, it will have a global scope. A local variable can have the same name as a global variable.

Thanks for the quote

I just googled here and it does help. thanks