Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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".



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: