lib/field.filter.js
function getItemsFromList(list, itemsToGet) {
    var result = [];

    _.each(list, function (item) {
        for (var i = 0; i < itemsToGet.length; i++) {
            if (item.indexOf(itemsToGet[i]) === 0) {
                result.push(item);
            }
        }
    });

    return result;
}
function getItemsFromList(list, itemsToGet) {
    var result = [];

    _.each(list, function (item) {
        for (var i = 0; i < itemsToGet.length; i++) {
            if (item.indexOf(itemsToGet[i]) === 0) {
                result.push(item);
            }
        }
    });

    return result;
}
function getItemsFromList ( list , itemsToGet ) { var result = [ ] ; _ . each ( list , function ( item ) { for ( var i = 0 ; i < itemsToGet . length ; i ++ ) { if ( item . indexOf ( itemsToGet [ i ] ) === 0 ) { result . push ( item ) ; } } } ) ; return result ; }
Get all items from a list that match specified items.
@param list
@param itemsToGet
@returns {Array}
Get all items from a list that match specified items .