docs: function updateEntitlements(entitlements, preferences) {
      const domains = [];
      let prev = entitlements[ASSOCIATED_DOMAINS];
      const next = updateAssociatedDomains(preferences);
  
      prev = removePreviousAssociatedDomains(preferences, prev);
      entitlements[ASSOCIATED_DOMAINS] = domains.concat(prev, next);
  
      return entitlements;
    }