Perils of Omitting “var”
Note: This was originally posted on my blog at https://therobinkim.com/blog/perils-of-omitting-var. Any updates will appear there and not here.
A JavaScript app will run whether you precede variable declarations with var
. However, when you're creating new…