I’ve seen backbone views (or models, collections etc), declared like this
var SomeView = Backbone.View.extend({...
I’ve also seen them declared like this
window.SomeView = Backbone.View.extend({...
Could someone please explain the pros/cons in each case?
Really it does the same thing: http://snook.ca/archives/javascript/global_variable
However http://documentcloud.github.com/backbone/#View-constructor example goes with the first example and would be understood by a larger audience.