LookupMatcher = function (isAvailableLocale, requestedLocales) {
        const result = _.create();
        for (let i = 0; i < requestedLocales.length; ++i) {
            const parsedLangtag = parseLangtag(requestedLocales[i]);
            if (parsedLangtag === null) {
                continue;
            }

            const availableLocale = BestAvailableLocale(isAvailableLocale, parsedLangtag.base);
            if (availableLocale !== undefined) {
                result.locale = availableLocale;
                if (requestedLocales[i] !== parsedLangtag.base) {
                    result.extension = parsedLangtag.unicodeExtension;
                }

                return result;
            }
        }

        result.locale = GetDefaultLocale();
        return result;
    }
Determines which locale (or fallback) to use of an array of locales.

ECMA-402: #sec-lookupmatcher

@param {Function} isAvailableLocale A function that takes a locale and returns if the locale is supported
@param {String[]} requestedLocales An array of requested locales