Standard built-ins
Intl.ListFormat
Format ordered strings as locale-sensitive conjunctions, disjunctions or unit lists.
Formal Syntax & Structure
javascript syntaxjavascript
new Intl.ListFormat([locales], [options])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| locales | String | Array | Requested locale tag or prioritized locale list. |
| options | Object | Formatting options. |
Return Value
Intl.ListFormat
New formatter.
Working Example
Example Snippetjavascript
console.log(new Intl.ListFormat("en-US").format(["a","b"]));