I'm reading the Backbone.js documents and am seeing a lot of code that assigns attributes to the window object:
window.something = "whatever";
What's the difference between calling this code, and just assigning the variable and creating a global variable, like this:
something = "whatever";
I assume there is some kind of scope difference, and/or object ownership difference (window being the owner vs. not), but I am interested in the detail between the two and why I would use window vs. not use it.