Returns a localized list string using Intl.ListFormat. Falls back to a simple comma-joined string if formatting fails.
Intl.ListFormat
The array of strings to format
Optional
Optional locale string
The list format type (default: 'conjunction')
The list format style (default: 'long')
The localized list string
formatList(['A', 'B', 'C'], 'en'); // 'A, B, and C' Copy
formatList(['A', 'B', 'C'], 'en'); // 'A, B, and C'
Returns a localized list string using
Intl.ListFormat. Falls back to a simple comma-joined string if formatting fails.