Spec-Zone.ru › JavaScript

Intl.ListFormat.prototype.resolvedOptions()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It's been available across browsers since April 2021.

The resolvedOptions() method of Intl.ListFormat instances returns a new object with properties reflecting the options computed during initialization of this ListFormat object.

Try it

const deListFormatter = new Intl.ListFormat("de-DE", { type: "disjunction" });
const options = deListFormatter.resolvedOptions();

console.log(options.locale);
// Expected output: "de-DE"

console.log(options.style);
// Expected output: "long"

console.log(options.type);
// Expected output: "disjunction"

Syntax

resolvedOptions()

Parameters

None.

Return value

A new object with properties reflecting the options computed during the initialization of this ListFormat object. The object has the following properties, in the order they are listed:

locale
The BCP 47 language tag for the locale actually used, determined by the locale negotiation process. No Unicode extension key will be included in the output.
type
The value provided for this property in the options argument, with default filled in as needed. It is either "conjunction", "disjunction", or "unit". The default is "conjunction".
style
The value provided for this property in the options argument, with default filled in as needed. It is either "long", "short", or "narrow". The default is "long".

Examples

Using resolvedOptions

const deListFormatter = new Intl.ListFormat("de-DE", { style: "short" });

const usedOptions = de.resolvedOptions();
console.log(usedOptions.locale); // "de-DE"
console.log(usedOptions.style); // "short"
console.log(usedOptions.type); // "conjunction" (the default value)

Specifications

Specification
ECMAScript® 2027 Internationalization API Specification
# sec-Intl.ListFormat.prototype.resolvedoptions

Browser compatibility

Desktop Mobile Server
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on iOS Samsung Internet WebView Android WebView on iOS Bun Deno Node.js
resolvedOptions
72
79
78
60
14.1Only available on macOS Big Sur (11) and above.
72
79
51
14.5
11.0
72
14.5
1.0.3
1.8
12.0.0Before version 13.0.0, only the locale data for en-US is available by default. See the ListFormat() constructor for more details.

See also

  • Intl.ListFormat
  • Intl.NumberFormat.prototype.resolvedOptions()
  • Intl.Collator.prototype.resolvedOptions()
  • Intl.DateTimeFormat.prototype.resolvedOptions()
  • Intl.PluralRules.prototype.resolvedOptions()

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API