ads/google/a4a/experiment-utils.js
/**
 * Attempts to select into experiment and forces branch if selected.
 * @param {!Window} win
 * @param {!Element} element
 * @param {!Array<string>} branches
 * @param {string} expName
 * @param {boolean=} optAddExpIdToElement
 * @return {*} TODO(#23582): Specify return type
 */
Attempts to select into experiment and forces branch if selected.
Attempts to select into experiment and forces branch if selected .
function selectAndSetExperiments(
  win,
  element,
  branches,
  expName,
  optAddExpIdToElement
) {
  const experimentId = expUtils.maybeSelectExperiment(
    win,
    element,
    branches,
    expName
  );
  if (!!experimentId) {
    addExperimentIdToElement(
      optAddExpIdToElement ? experimentId : undefined,
      element
    );
    forceExperimentBranch(win, expName, experimentId);
  }
  return experimentId;
}
function selectAndSetExperiments ( win , element , branches , expName , optAddExpIdToElement ) { const experimentId = expUtils . maybeSelectExperiment ( win , element , branches , expName ) ; if ( ! ! experimentId ) { addExperimentIdToElement ( optAddExpIdToElement ? experimentId : undefined , element ) ; forceExperimentBranch ( win , expName , experimentId ) ; } return experimentId ; }
Attempts to select into experiment and forces branch if selected.
Attempts to select into experiment and forces branch if selected .