In regards to global references, this guide suggests not to use the window prefix but doesn't really explain why except to note that it's unnecessary. I am guessing this is because window is not available if the js is running outside the browser. But if the code is intended to be run in the browser and won't work elsewhere I prefer adding the prefix to signal that.