function suggest(sSubject, aStrings) {
    return aStrings
        .map(s => ({
            s,
            d: distance(sSubject, s)
        }))
        .sort((a, b) => a.d - b.d)
        .shift()
        .s;
}
/**
 * checks all strings inside aStrings and selects the most similar to sSubject
 * @param sSubject
 * @param aStrings
 * @returns {*}
 */
checks all strings inside aStrings and selects the most similar to sSubject
@param sSubject
@param aStrings
@returns {*}
checks all strings inside aStrings and selects the most similar to sSubject @param sSubject @param aStrings @returns { * }
function suggest(sSubject, aStrings) {
    return aStrings
        .map(s => ({
            s,
            d: distance(sSubject, s)
        }))
        .sort((a, b) => a.d - b.d)
        .shift()
        .s;
}
function suggest ( sSubject , aStrings ) { return aStrings . map ( s => ( { s , d : distance ( sSubject , s ) } ) ) . sort ( ( a , b ) => a . d - b . d ) . shift ( ) . s ; }
checks all strings inside aStrings and selects the most similar to sSubject
 @param sSubject
 @param aStrings
 @returns {*}
checks all strings inside aStrings and selects the most similar to sSubject @param sSubject @param aStrings @returns { * }