Standard built-ins

Intl.ListFormat.prototype.format()

Try the free JavaScript compiler

Join iterable strings in original order using locale-specific list pattern.

Formal Syntax & Structure

javascript syntaxjavascript
formatter.format([list])

Parameters & Attributes

NameTypeDescription
listIterable<String>Strings in display order.

Return Value

String

Localized list.

Working Example

Example Snippetjavascript
console.log(new Intl.ListFormat("en-US",{type:"disjunction"}).format(["x","y"]));
JavaScript Reference