index.js
function matchAccept (properties, langs) {
    let match = null;
    let priority = 0;

    base: for(const lang of langs) {
        for (const property of properties) {
            if (property.priority === 0) {
                break;
            }

            if (priority < property.priority){
                if (lang.lang === property.lang) {
                    match = lang.raw;
                    priority = property.priority + 0.001;
                    break;
                }
                if (lang.bcp47.language === property.bcp47.language) {
                    match = lang.raw;
                    priority = property.priority;
                    break;
                }
            }
        }
    }

    return match;
}
function matchAccept (properties, langs) {
    let match = null;
    let priority = 0;

    base: for(const lang of langs) {
        for (const property of properties) {
            if (property.priority === 0) {
                break;
            }

            if (priority < property.priority){
                if (lang.lang === property.lang) {
                    match = lang.raw;
                    priority = property.priority + 0.001;
                    break;
                }
                if (lang.bcp47.language === property.bcp47.language) {
                    match = lang.raw;
                    priority = property.priority;
                    break;
                }
            }
        }
    }

    return match;
}
function matchAccept ( properties , langs ) { let match = null ; let priority = 0 ; base : for ( const lang of langs ) { for ( const property of properties ) { if ( property . priority === 0 ) { break ; } if ( priority < property . priority ) { if ( lang . lang === property . lang ) { match = lang . raw ; priority = property . priority + 0.001 ; break ; } if ( lang . bcp47 . language === property . bcp47 . language ) { match = lang . raw ; priority = property . priority ; break ; } } } } return match ; }
search match by BCP47 Objects
@param  {Array} properties
@param  {Array} langs
@return {string}
search match by BCP47 Objects