One of the first things I learned when writing JavaScript was that it bad practice to set variables on window
and polluting the global namespace.
Looking around there are loads of articles as there are SO questions on why it is considered bad practice and even how to measure the amount of objects stored (here).
But even if I can get the amount of objects being stored on window
I have never read anything about the actual performance hit taken by cluttering window
.
Question:
Are there any examples showing how name space pollution drains performance?