Intl​.List​Format​.prototype​.resolvedOptions()

Draft
This page is not complete.

The Intl.ListFormat.prototype.resolvedOptions() method returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current ListFormat object.

Syntax

listFormat.resolvedOptions()

Return value

An object with properties reflecting the locale and formatting options computed during the construction of the given ListFormat object.

Description

The object returned by resolvedOptions() has the following properties:

locale
The BCP 47 language tag for the locale actually used. If any Unicode extension values were requested in the input BCP 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale.
style
The value provided for this property in the options argument of the constructor or the default value ("long"). Its value is either "long", "short", or "narrow".
type
The value provided for this property in the options argument of the constructor or the default value ("conjunction"). Its value is either "conjunction", "disjunction", or "unit".

Examples

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 Status Comment
Intl.ListFormat.prototype.resolvedOptions() proposal Stage 3

Browser compatibility

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
resolvedOptions
Experimental
Chrome Full support 72Edge No support NoFirefox No support NoIE No support NoOpera Full support 60Safari No support NoWebView Android Full support 72Chrome Android Full support 72Firefox Android No support NoOpera Android ? Safari iOS No support NoSamsung Internet Android Full support Yesnodejs No support No

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

See also

Document Tags and Contributors

Contributors to this page: SphinxKnight, rwe2020, sideshowbarker
Last updated by: SphinxKnight,