Format List

Format an array as a human-readable list with 'and' or 'or' conjunctions.

Code

Utilities
new Intl.ListFormat('en', { style: 'long', type }).format(arr);

Parameters

Array of items.

Type: conjunction (and) or disjunction (or).

Browser·fetch() may be limited by CORS

More JavaScript Snippets