javascript var scope

Published

Good explaination here

Basically the variable becomes local only when you use var inside a function.