4 ms·
fwiw these are not the same thing in this context. the example doesn't actually declare appview in the window namespace, possibly intentionally. i agree it's a
by catshirt 16y ago
fwiw these are not the same thing in this context. the example doesn't actually declare appview in the window namespace, possibly intentionally. i agree it's a bit unclear though.
- alexpeattie 16y agoOf course you're right, they're not identical, but I don't think there's any practical difference between them here - they both initiate the view; but using the window namespace seems more readable, and is an established idiom. Maybe it is intentional, but I don't think so?
- bluesmoon 16y agobut that would assume a browser, right?
- catshirt 16y agoi think for a backbone view it's a fine assumption. i didn't mean to be nitpicky, just an fyi for anyone reading unaware.
- alexpeattie 16y agoIt does, but as catshirt says, that's probably reasonable. Especially as jQuery assumes a browser (and relies on the window namespace) too - so it wouldn't be suitable for a browserless environment anyway...