examples/map/js/backbone.marionette.js
function(regionDefinitions, defaults){
      var regions = {};

      _.each(regionDefinitions, function(definition, name){
        if (typeof definition === "string"){
          definition = { selector: definition };
        }

        if (definition.selector){
          definition = _.defaults({}, definition, defaults);
        }

        var region = this.addRegion(name, definition);
        regions[name] = region;
      }, this);

      return regions;
    }
function(regionDefinitions, defaults){
      var regions = {};

      _.each(regionDefinitions, function(definition, name){
        if (typeof definition === "string"){
          definition = { selector: definition };
        }

        if (definition.selector){
          definition = _.defaults({}, definition, defaults);
        }

        var region = this.addRegion(name, definition);
        regions[name] = region;
      }, this);

      return regions;
    }
function ( regionDefinitions , defaults ) { var regions = { } ; _ . each ( regionDefinitions , function ( definition , name ) { if ( typeof definition === "string" ) { definition = { selector : definition } ; } if ( definition . selector ) { definition = _ . defaults ( { } , definition , defaults ) ; } var region = this . addRegion ( name , definition ) ; regions [ name ] = region ; } , this ) ; return regions ; }
Add multiple regions using an object literal, where each key becomes the region name, and each value is the region definition.
Add multiple regions using an object literal where each key becomes the region name and each value is the region definition .