r/javascript • • Feb 23 '13

Common JavaScript "Gotchas"

https://github.com/stevekwan/best-practices/blob/master/javascript/gotchas.md
16 Upvotes

50 comments sorted by

View all comments

2

u/dangoodspeed Feb 23 '13

He says you should never ever have a global variable or global function. Do other people agree with that?

2

u/mirion Feb 23 '13

No, lol. It shouldn't be abused, but it is extremely useful in limited circumstances. You can't, for example, use write library code without it.