function scan(language) {
            var i;
            for (i = 0; i < availableLanguages.length; i += 1) {
                if (language.toLowerCase() ===
                            availableLanguages[i].toLowerCase()) {
                    return availableLanguages[i];
                }
            }
        }
Returns the language among those available that
best matches the preferred language list, using the Lookup
algorithm of BCP 47.
If none of the available languages meets the user's preferences,
then "" is returned.
Extended language ranges are not supported.

@method lookupBestLang
@param {String[] | String} preferredLanguages The list of preferred
languages in descending preference order, represented as BCP 47
language tags. A string array or a comma-separated list.
@param {String[]} availableLanguages The list of languages
that the application supports, represented as BCP 47 language
tags.

@return {String} The available language that best matches the
preferred language list, or "".
@since 3.1.0