Intl.ListFormat
Creates an Intl.ListFormat object that enables language-sensitive list formatting
Syntax
new Intl.ListFormat(locales?, options?)Parameters
| Parameter | Type | Description |
|---|---|---|
| locales | string | string[] | A BCP 47 language tag or array of tags |
| options | Intl.ListFormatOptions | Options: type (conjunction, disjunction, unit), style |
Return Value
An Intl.ListFormat object with a format() method
Examples
const lf = new Intl.ListFormat('en', { type: 'conjunction' })
console.log(lf.format(['Apple', 'Banana', 'Cherry']))
// 'Apple, Banana, and Cherry'const lf = new Intl.ListFormat('en', { type: 'disjunction' })
console.log(lf.format(['Red', 'Blue', 'Green']))
// 'Red, Blue, or Green'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
Intl.ListFormat.prototype.formatFormats a list of strings according to the locale and style options of this Intl.ListFormat object
Intl.NumberFormatCreates an Intl.NumberFormat object that enables language-sensitive number formatting
Intl.PluralRulesCreates an Intl.PluralRules object that enables plural-sensitive formatting and language-specific rules for plurals
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.