| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2021 ..
Intl.ListFormat , - .
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: "disjunction",
});
console.log(formatter2.format(vehicles));
// Expected output: "Motorcycle, Bus oder Car"
const formatter3 = new Intl.ListFormat("en", { style: "narrow", type: "unit" });
console.log(formatter3.format(vehicles));
// Expected output: "Motorcycle Bus Car"
new Intl.ListFormat([locales[, options]])
locales . BCP 47 . locales Intl.
options. :
localeMatcher
. : "lookup" "best fit"; "best fit". . Intl.type
. : "conjunction" "" ( , . A, B C) "disjunction" "" (. A, B C). "unit" (. 5 , 12 ).style
. : "long" ( , . A, B C); "short" "narrow" (. A, B, C). narrow, type unit.Intl.ListFormat.prototype Intl.ListFormat
format ListFormat format.
const list = ["Motorcycle", "Bus", "Car"];
console.log(
new Intl.ListFormat("ru-RU", { style: "long", type: "conjunction" }).format(
list,
),
);
// > Motorcycle, Bus Car
console.log(
new Intl.ListFormat("ru-RU", { style: "short", type: "disjunction" }).format(
list,
),
);
// > Motorcycle, Bus Car
console.log(
new Intl.ListFormat("ru-RU", { style: "narrow", type: "unit" }).format(list),
);
// > Motorcycle Bus Car
formatToParts ListFormat formatToParts.
const list = ["Motorcycle", "Bus", "Car"];
console.log(
new Intl.ListFormat("en-GB", {
style: "long",
type: "conjunction",
}).formatToParts(list),
);
// > [ { "type": "element", "value": "Motorcycle" }, { "type": "literal", "value": ", " }, { "type": "element", "value": "Bus" }, { "type": "literal", "value": ", and " }, { "type": "element", "value": "Car" } ];
| Specification |
|---|
| ECMAScript 2027 Internationalization API Specification # listformat-objects |
This page was last modified on 29 . 2026 . by MDN contributors.
Intl.ListFormatObject/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()IntlIntl.CollatorIntl.DateTimeFormatIntl.DisplayNamesIntl.DurationFormatIntl.LocaleIntl.NumberFormatIntl.PluralRulesIntl.RelativeTimeFormatIntl.SegmenterYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |