Intl

Intl.ListFormat

Creates an Intl.ListFormat object that enables language-sensitive list formatting

Syntax

JavaScript
new Intl.ListFormat(locales?, options?)

Parameters

ParameterTypeDescription
localesstring | string[]A BCP 47 language tag or array of tags
optionsIntl.ListFormatOptionsOptions: type (conjunction, disjunction, unit), style

Return Value

An Intl.ListFormat object with a format() method

Examples

Basic Usage
const lf = new Intl.ListFormat('en', { type: 'conjunction' })
console.log(lf.format(['Apple', 'Banana', 'Cherry']))
// 'Apple, Banana, and Cherry'
Practical Example
const lf = new Intl.ListFormat('en', { type: 'disjunction' })
console.log(lf.format(['Red', 'Blue', 'Green']))
// 'Red, Blue, or Green'
Advanced Usage
const lf = new Intl.ListFormat('en', { type: 'unit', style: 'narrow' })
console.log(lf.format(['6ft', '2in'])) // '6ft 2in'

Understanding Intl.ListFormat

The Intl.ListFormat method in JavaScript creates an Intl.ListFormat object that enables language-sensitive list formatting. It belongs to the Intl object and is one of the most widely used methods for working with intl values in modern JavaScript and TypeScript applications.

The method signature is new Intl.ListFormat(locales?, options?). It accepts 2 parameters: locales, options. When called, it returns an intl.listformat object with a format() method. Understanding when and how to use ListFormat() helps you write more expressive, readable code.

Common use cases for Intl.ListFormat include data transformation, input validation, API response processing, and building reusable utility functions. It works well alongside related methods like intl-listformat-format, intl-numberformat, intl-pluralrules, enabling you to chain operations together for complex data manipulation pipelines.

Browser support for Intl.ListFormat is excellent across all modern browsers including Chrome, Firefox, Safari, and Edge. It is also fully supported in Node.js and Deno. For older environments, transpilation with Babel or a polyfill may be needed.

Browser Compatibility

Supported in all modern browsers (Chrome, Firefox, Safari, Edge) and Node.js. Part of the ECMAScript standard.

Related Methods

More Intl Methods

Other methods in the Intl object

Related Tools

More Intl Methods

Explore JavaScript Methods

Browse our complete reference of 410 JavaScript methods with syntax, examples, and explanations.