3 ms·
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
by danmaz74 15y 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".