code: function hostInDomains(host, domains) {
    if (!defined(domains)) {
      return false;
    }
  
    host = host.toLowerCase();
    for (var i = 0; i < domains.length; i++) {
      if (host.match("(^|\\.)" + domains[i] + "$")) {
        return true;
      }
    }
    return false;
  }
docs: Determines whether this host is, or is a subdomain of, an item in the provided array.
  
  @param {String} host The host to search for
  @param {String[]} domains The array of domains to look in
  @returns {boolean} The result.