code: function(regionConfig, defaultRegionType){
  
      var regionIsString = (typeof regionConfig === "string");
      var regionSelectorIsString = (typeof regionConfig.selector === "string");
      var regionTypeIsUndefined = (typeof regionConfig.regionType === "undefined");
      var regionIsType = (typeof regionConfig === "function");
  
      if (!regionIsType && !regionIsString && !regionSelectorIsString) {
        throw new Error("Region must be specified as a Region type, a selector string or an object with selector property");
      }
  
      var selector, RegionType;
     
      // get the selector for the region
      
      if (regionIsString) {
        selector = regionConfig;
      } 
  
      if (regionConfig.selector) {
        selector = regionConfig.selector;
      }
  
      // get the type for the region
      
      if (regionIsType){
        RegionType = regionConfig;
      }
  
      if (!regionIsType && regionTypeIsUndefined) {
        RegionType = defaultRegionType;
      }
  
      if (regionConfig.regionType) {
        RegionType = regionConfig.regionType;
      }
      
      // build the region instance
      var region = new RegionType({
        el: selector
      });
  
      // override the `getEl` function if we have a parentEl
      // this must be overridden to ensure the selector is found
      // on the first use of the region. if we try to assign the
      // region's `el` to `parentEl.find(selector)` in the object
      // literal to build the region, the element will not be
      // guaranteed to be in the DOM already, and will cause problems
      if (regionConfig.parentEl){
  
        region.getEl = function(selector) {
          var parentEl = regionConfig.parentEl;
          if (_.isFunction(parentEl)){
            parentEl = parentEl();
          }
          return parentEl.find(selector);
        };
      }
  
      return region;
    }
docs: Build an instance of a region by passing in a configuration object and a default region type to use if none is specified in the config.  The config object should either be a string as a jQuery DOM selector, a Region type directly, or an object literal that specifies both a selector and regionType:  ```js { selector: "#foo", regionType: MyCustomRegion } ```