can someone please explain what’s the exports variable for:
copied from backbone.js, I also noticed spine.js uses the same pattern.
https://gist.github.com/1375748
var Backbone;
if (typeof exports !== 'undefined') {
Backbone = exports;
} else {
Backbone = root.Backbone = {};
}
That module pattern is part of the CommonJS specification called CommonJS Modules:
So basically adding to the exports object defines the API your module exposes.