Hacker News new | ask | show | jobs
by danmaz74 5287 days ago
With "var" and shadowing you can still shoot yourself in the foot, it's just the other foot.

If you need global variables, it's sensible to just adopt a simple naming convention, like prepending g_ (or whatever pleases you) to all your variables. I already did that with plain JS and it's well worth the "effort".