is it possible for Intl to exist without Intl.ListFormat existing

40 views Asked by At

I have added this check

if (!Intl) {
return array.join(", ");
}
// Use Intl.ListFormat to format the array as a Internationalized list.
const list_formatter = new Intl.ListFormat(user_settings.default_language, {style, type});

// Return the formatted string.
return list_formatter.format(array);

So, is it possible for some browser for Intl to exist, but Intl.ListFormat does not exist.

is it possible for Intl to exist without Intl.ListFormat existing.

1

There are 1 answers

1
Nandeshhwar Katenga On

Yes, it is possible for the Intl object to exist in some browser environments while Intl.ListFormat may not be available. Some older browser versions or specific environments might have partial support for the Intl object and may lack support for certain features like Intl.ListFormat. In such cases, the ListFormat feature might not be available even if the Intl object itself is present.