function filterLanguages(statuses) {
        return new Promise(function(resolve) {
            // Map statuses to a detector Promise
            statuses = statuses.map(function(status) {
                return detector(status);
            });

            // Wait for all promises to be completed
            Promise.all(statuses).then(function(data) {
                // Filter errors out
                resolve(data.filter(function(status) {
                    return status !== null;
                }));
            });
        });
    }
/**
     * Filter statuses array based on language criteria
     * @param statuses
     * @returns {Promise}
     */
Filter statuses array based on language criteria
@param statuses
@returns {Promise}
Filter statuses array based on language criteria @param statuses @returns { Promise }
function filterLanguages(statuses) {
        return new Promise(function(resolve) {
            statuses = statuses.map(function(status) {
                return detector(status);
            });
            Promise.all(statuses).then(function(data) {
                resolve(data.filter(function(status) {
                    return status !== null;
                }));
            });
        });
    }
function filterLanguages ( statuses ) { return new Promise ( function ( resolve ) { statuses = statuses . map ( function ( status ) { return detector ( status ) ; } ) ; Promise . all ( statuses ) . then ( function ( data ) { resolve ( data . filter ( function ( status ) { return status !== null ; } ) ) ; } ) ; } ) ; }
Filter statuses array based on language criteria
 @param statuses
 @returns {Promise}
Filter statuses array based on language criteria @param statuses @returns { Promise }
// Map statuses to a detector Promise // Wait for all promises to be completed // Filter errors out