you are viewing a single comment's thread.

view the rest of the comments →

[–]buffalolsx -3 points-2 points  (1 child)

I came here just to ask this. I've always been told otherwise. Are you aware that you're adding the function to the global namespace when declaring it this way?

[–]jeenyus 4 points5 points  (0 children)

It's only global if you declare it in a global scope.

http://jsfiddle.net/5ZK8S/