Standard built-ins

Intl.ListFormat

Try the free JavaScript compiler

Format ordered strings as locale-sensitive conjunctions, disjunctions or unit lists.

Formal Syntax & Structure

javascript syntaxjavascript
new Intl.ListFormat([locales], [options])

Parameters & Attributes

NameTypeDescription
localesString | ArrayRequested locale tag or prioritized locale list.
optionsObjectFormatting options.

Return Value

Intl.ListFormat

New formatter.

Working Example

Example Snippetjavascript
console.log(new Intl.ListFormat("en-US").format(["a","b"]));
JavaScript Reference