Search e01
One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.
6 results across 6 corpora for Intl.ListFormat.prototype.format().
Developer library 6
Firefox 78 release notes for developers
ttps://html.spec.whatwg.org/multipage/semantics-other.html#selector-read-write) ([Firefox bug 888884](https://bugzil.la/888884)). ### JavaScript - The [`Intl.ListFormat`](/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat) API is now supported ([Firefox bug 1589095](https://bugzil.la/1589095)). - The [`Intl.NumberFormat()`](/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) con
Array.prototype.toLocaleString()
each element. The actual separator (usually a comma) depends solely on the host's current locale. If you expect localized list formatting, consider using Intl.ListFormat instead. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. When used on [sparse arrays](/docs/Web/JavaScript/Guide/Indexed_collections#sparse_arrays), the `toLocaleString()` m
Intl
tion of language, region and script display names. - Intl.DurationFormat - : Constructor for objects that enable locale-sensitive duration formatting. - Intl.ListFormat - : Constructor for objects that enable language-sensitive list formatting. - Intl.Locale - : Constructor for objects that represent a Unicode locale identifier. - Intl.NumberFormat - : Constructor for objects that enable language-sensitive nu
Intl.ListFormat
The **`Intl.ListFormat`** object enables language-sensitive list formatting. taller ```js interactive-example const vehicles = ["Motorcycle", "Bus", "Car"]; const formatter = new Intl.ListFormat("en", { style: "long", type: "conjunction", }); console.log(formatter.format(vehicles)); // Expected output: "Motorcycle, Bus, and Car" const formatter2 = new Intl.ListFormat("de", { style: "short", type: "disjunc
Intl.ListFormat.prototype.formatToParts()
The **`formatToParts()`** method of Intl.ListFormat instances returns an array of objects representing each part of the formatted string that would be returned by format(). It is useful for building custom strings from the locale-specific tokens. taller ```js interactive-example const vehicles = ["Motorcycle", "Bus", "Car"]; const formatterEn = new Intl.ListFormat("en", { style: "long", type: "conjunction", })
Intl.ListFormat.prototype.format()
The **`format()`** method of Intl.ListFormat instances returns a string with a language-specific representation of the list. taller ```js interactive-example const vehicles = ["Motorcycle", "Bus", "Car"]; const formatter = new Intl.ListFormat("en", { style: "long", type: "conjunction", }); console.log(formatter.format(vehicles)); // Expected output: "Motorcycle, Bus, and Car" const formatter2 = new Intl.ListF