code: function FindMetaDataForRegion(region) {
      // Check in the region cache first. This will find all entries we have
      // already resolved (parsed from a string encoding).
      var md = regionCache[region];
      if (md)
        return md;
      for (var countryCode in dataBase) {
        var entry = dataBase[countryCode];
        // Each entry is a string encoded object of the form '["US..', or
        // an array of strings. We don't want to parse the string here
        // to save memory, so we just substring the region identifier
        // and compare it. For arrays, we compare against all region
        // identifiers with that country code. We skip entries that are
        // of type object, because they were already resolved (parsed into
        // an object), and their country code should have been in the cache.
        if (Array.isArray(entry)) {
          for (var n = 0; n < entry.length; n++) {
            if (typeof entry[n] == "string" && entry[n].substr(2,2) == region) {
              if (n > 0) {
                // Only the first entry has the formats field set.
                // Parse the main country if we haven't already and use
                // the formats field from the main country.
                if (typeof entry[0] == "string")
                  entry[0] = ParseMetaData(countryCode, entry[0]);
                var formats = entry[0].formats;
                var current = ParseMetaData(countryCode, entry[n]);
                current.formats = formats;
                return entry[n] = current;
              }
  
              entry[n] = ParseMetaData(countryCode, entry[n]);
              return entry[n];
            }
          }
          continue;
        }
        if (typeof entry == "string" && entry.substr(2,2) == region)
          return dataBase[countryCode] = ParseMetaData(countryCode, entry);
      }
    }
docs: Search for the meta data associated with a region identifier ("US") in our database, which is indexed by country code ("1"). Since we have to walk the entire database for this, we cache the result of the lookup for future reference.