Chuck Conway

In The craft

Var or Not to Var in Javascript

September 3, 2013 · 1 minute read

Using var in Javascript creates a locally scoped variable. If the var keyword is omitted then the variable is initialized into the global space.

Don’t forget your var!