MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/192tn4/common_javascript_gotchas/c8kf3hd/?context=3
r/javascript • u/stevekwan • Feb 23 '13
50 comments sorted by
View all comments
2
He says you should never ever have a global variable or global function. Do other people agree with that?
1 u/stevekwan Feb 23 '13 Sorry, I should make that clear. Globals are unavoidable to some degree, unless you are assigning no names to anything at all. :) But I try to use globals only where it makes sense, eg for namespaces and other top-level containers.
1
Sorry, I should make that clear. Globals are unavoidable to some degree, unless you are assigning no names to anything at all. :) But I try to use globals only where it makes sense, eg for namespaces and other top-level containers.
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?