function changeSelectedValue(select, optValue) {
    if (!isHTMLElement(select, "select")) {
      throw new TypeError("Bad argument: The given 'select' argument is not a valid HTML Select element");
    }

    if (!(isString(optValue) || isObject(optValue))) {
      throw new TypeError("Bad argument: The given 'optValue' argument is a null or undefined");
    }
    /**
     * Object equality
     * @param {HTMLOptionElement} option 
     * @param {*} obj 
     */


    var objectEq = function objectEq(option, obj) {
      return option.value === obj.value || option.text === obj.text;
    };
    /**
     * String equality
     * @param {HTMLOptionElement} option 
     * @param {string} obj 
     */


    var stringEq = function stringEq(option, value) {
      return option.value === value;
    };

    var eqHandler = isString(optValue) ? stringEq : objectEq;
    var options = select.options,
        multiple = select.multiple;

    for (var i = 0; i < options.length; i++) {
      var option = options[i];

      if (eqHandler(option, optValue)) {
        if (!multiple) {
          Array.from(select.selectedOptions).forEach(function (opt) {
            return opt.selected = false;
          });
        }

        option.selected = true;
        return true;
      }
    }

    return false;
  }
/**
   * Changes the selected option of a `<select>` element
   * @param {!HTMLSelectElement} select
   * @param {!string} optValue option value to select
   * @returns {boolean} value indicating whether the option was found and selected
   * @memberof DOM
   */
Changes the selected option of a `` element
@param {!HTMLSelectElement} select
@param {!string} optValue option value to select
@returns {boolean} value indicating whether the option was found and selected
@memberof DOM
Changes the selected option of a ` ` element @param { !HTMLSelectElement } select @param { !string } optValue option value to select @returns { boolean } value indicating whether the option was found and selected @memberof DOM
function changeSelectedValue(select, optValue) {
    if (!isHTMLElement(select, "select")) {
      throw new TypeError("Bad argument: The given 'select' argument is not a valid HTML Select element");
    }
    if (!(isString(optValue) || isObject(optValue))) {
      throw new TypeError("Bad argument: The given 'optValue' argument is a null or undefined");
    }
    var objectEq = function objectEq(option, obj) {
      return option.value === obj.value || option.text === obj.text;
    };
    var stringEq = function stringEq(option, value) {
      return option.value === value;
    };
    var eqHandler = isString(optValue) ? stringEq : objectEq;
    var options = select.options,
        multiple = select.multiple;
    for (var i = 0; i < options.length; i++) {
      var option = options[i];
      if (eqHandler(option, optValue)) {
        if (!multiple) {
          Array.from(select.selectedOptions).forEach(function (opt) {
            return opt.selected = false;
          });
        }
        option.selected = true;
        return true;
      }
    }
    return false;
  }
function changeSelectedValue ( select , optValue ) { if ( ! isHTMLElement ( select , "select" ) ) { throw new TypeError ( "Bad argument: The given 'select' argument is not a valid HTML Select element" ) ; } if ( ! ( isString ( optValue ) || isObject ( optValue ) ) ) { throw new TypeError ( "Bad argument: The given 'optValue' argument is a null or undefined" ) ; } var objectEq = function objectEq ( option , obj ) { return option . value === obj . value || option . text === obj . text ; } ; var stringEq = function stringEq ( option , value ) { return option . value === value ; } ; var eqHandler = isString ( optValue ) ? stringEq : objectEq ; var options = select . options , multiple = select . multiple ; for ( var i = 0 ; i < options . length ; i ++ ) { var option = options [ i ] ; if ( eqHandler ( option , optValue ) ) { if ( ! multiple ) { Array . from ( select . selectedOptions ) . forEach ( function ( opt ) { return opt . selected = false ; } ) ; } option . selected = true ; return true ; } } return false ; }
Changes the selected option of a `<select>` element
 @param {!HTMLSelectElement} select
 @param {!string} optValue option value to select
 @returns {boolean} value indicating whether the option was found and selected
 @memberof DOM
Changes the selected option of a ` <select > ` element @param { !HTMLSelectElement } select @param { !string } optValue option value to select @returns { boolean } value indicating whether the option was found and selected @memberof DOM
/**
     * Object equality
     * @param {HTMLOptionElement} option 
     * @param {*} obj 
     */ /**
     * String equality
     * @param {HTMLOptionElement} option 
     * @param {string} obj 
     */