Javascript variable scoping

While working on a Web application recently, I came across a Javascript gotcha that I shouldn’t have faced in the first place.As a matter of habit, I have made it a point to always declare variables inside a js function with the var keyword. I know many of us...