function select(filter, from, settings) {
    /*jshint latedef:false, laxbreak:true*/
    function getDefaultValue(value) {
        return "defaultValue" in options
            ? options.defaultValue
            : value;
    }

    var sClass = getClass(from),
        options = settings || {},
        result = getDefaultValue(from),
        key, keyList, nI, nL, nLast;
    if (sClass === "Array" || sClass === "Set") {
        if (sClass === "Set") {
            from = getKeys(from);
        }
        nL = from.length;
        if (nL) {
            nLast = nL - 1;
            for (nI = 0; nI < nL; nI++) {
                if (checkField(from, nI, filter, options)) {
                    result = from[nI];
                    break;
                }
                else if (nI === nLast) {
                    result = getDefaultValue(from[nI]);
                }
            }
        }
        else {
            result = getDefaultValue(key);
        }
    }
    else if (sClass === "Map") {
        result = getDefaultValue(key);
        keyList = getKeys(from);
        for (nI = 0, nL = keyList.length; nI < nL; nI++) {
            key = keyList[nI];
            if (checkField(from, key, filter, options)) {
                result = from.get(key);
                break;
            }
        }
    }
    else if (getType(from) === "object") {
        result = getDefaultValue(key);
        for (key in from) {
            if (checkField(from, key, filter, options)) {
                result = from[key];
                break;
            }
        }
    }
    return result;
}
/**
 * Return the value of the first element/field in the passed array/object/map/set that satisfies the specified filter(s).
 * 
 * If value passed for selection is not an array/set nor an object/map and `settings.defaultValue` is not set, the value will be returned as is.
 * If no element in the passed array/set satisfies the specified filter(s),
 * `settings.defaultValue` or the last element of the array/set (or `undefined` when the array is empty) will be returned.
 * If no field in the passed object/map satisfies the specified filter(s), `settings.defaultValue` or `undefined` will be returned.
 *
 * @param {Any} filter
 *      Filter that should be used to select a value (see {@link module:adam.checkField checkField} for details).
 * @param {Any} from
 *      An array/object/map/set from which a value should be selected.
 * @param {Object} [settings]
 *     Operation settings. Keys are settings names, values are corresponding settings values.
 *     The following settings are supported (setting's default value is specified in parentheses):
 *     
 *   * `defaultValue`: `Any` - default value that should be used when no element/field in the passed array/object/map/set
 *      satisfies the specified filter(s) or when value of `from` parameter is not an array/set nor an object/map
 *   * `filterConnect`: `String` (`and`) - a boolean connector that should be used when array of filters is specified
 *      in `filter` parameter (see {@link module:adam.checkField checkField} for details)
 * @return {Any}
 *      The value of first element/field in the passed array/object/map/set that satisfies the specified filter(s),
 *      or `settings.defaultValue`, or the value of `from` parameter or `undefined`.
 * @alias module:adam.select
 * @see {@link module:adam.checkField checkField}
 */
Return the value of the first element/field in the passed array/object/map/set that satisfies the specified filter(s).

If value passed for selection is not an array/set nor an object/map and `settings.defaultValue` is not set, the value will be returned as is.
If no element in the passed array/set satisfies the specified filter(s),
`settings.defaultValue` or the last element of the array/set (or `undefined` when the array is empty) will be returned.
If no field in the passed object/map satisfies the specified filter(s), `settings.defaultValue` or `undefined` will be returned.

@param {Any} filter
Filter that should be used to select a value .
@param {Any} from
An array/object/map/set from which a value should be selected.
@param {Object} [settings]
Operation settings. Keys are settings names, values are corresponding settings values.
The following settings are supported (setting's default value is specified in parentheses).


Return the value of the first element / field in the passed array / object / map / set that satisfies the specified filter ( s ) . If value passed for selection is not an array / set nor an object / map and ` settings . defaultValue ` is not set the value will be returned as is . If no element in the passed array / set satisfies the specified filter ( s ) ` settings . defaultValue ` or the last element of the array / set ( or ` undefined ` when the array is empty ) will be returned . If no field in the passed object / map satisfies the specified filter ( s ) ` settings . defaultValue ` or ` undefined ` will be returned . @param { Any } filter Filter that should be used to select a value . @param { Any } from An array / object / map / set from which a value should be selected . @param { Object } [ settings ] Operation settings . Keys are settings names values are corresponding settings values . The following settings are supported ( setting ' s default value is specified in parentheses ) .
function select(filter, from, settings) {
    function getDefaultValue(value) {
        return "defaultValue" in options
            ? options.defaultValue
            : value;
    }
    var sClass = getClass(from),
        options = settings || {},
        result = getDefaultValue(from),
        key, keyList, nI, nL, nLast;
    if (sClass === "Array" || sClass === "Set") {
        if (sClass === "Set") {
            from = getKeys(from);
        }
        nL = from.length;
        if (nL) {
            nLast = nL - 1;
            for (nI = 0; nI < nL; nI++) {
                if (checkField(from, nI, filter, options)) {
                    result = from[nI];
                    break;
                }
                else if (nI === nLast) {
                    result = getDefaultValue(from[nI]);
                }
            }
        }
        else {
            result = getDefaultValue(key);
        }
    }
    else if (sClass === "Map") {
        result = getDefaultValue(key);
        keyList = getKeys(from);
        for (nI = 0, nL = keyList.length; nI < nL; nI++) {
            key = keyList[nI];
            if (checkField(from, key, filter, options)) {
                result = from.get(key);
                break;
            }
        }
    }
    else if (getType(from) === "object") {
        result = getDefaultValue(key);
        for (key in from) {
            if (checkField(from, key, filter, options)) {
                result = from[key];
                break;
            }
        }
    }
    return result;
}
function select ( filter , from , settings ) { function getDefaultValue ( value ) { return "defaultValue" in options ? options . defaultValue : value ; } var sClass = getClass ( from ) , options = settings || { } , result = getDefaultValue ( from ) , key , keyList , nI , nL , nLast ; if ( sClass === "Array" || sClass === "Set" ) { if ( sClass === "Set" ) { from = getKeys ( from ) ; } nL = from . length ; if ( nL ) { nLast = nL - 1 ; for ( nI = 0 ; nI < nL ; nI ++ ) { if ( checkField ( from , nI , filter , options ) ) { result = from [ nI ] ; break ; } else if ( nI === nLast ) { result = getDefaultValue ( from [ nI ] ) ; } } } else { result = getDefaultValue ( key ) ; } } else if ( sClass === "Map" ) { result = getDefaultValue ( key ) ; keyList = getKeys ( from ) ; for ( nI = 0 , nL = keyList . length ; nI < nL ; nI ++ ) { key = keyList [ nI ] ; if ( checkField ( from , key , filter , options ) ) { result = from . get ( key ) ; break ; } } } else if ( getType ( from ) === "object" ) { result = getDefaultValue ( key ) ; for ( key in from ) { if ( checkField ( from , key , filter , options ) ) { result = from [ key ] ; break ; } } } return result ; }
Return the value of the first element/field in the passed array/object/map/set that satisfies the specified filter(s).
Return the value of the first element / field in the passed array / object / map / set that satisfies the specified filter ( s ) .
/*jshint latedef:false, laxbreak:true*/