Web/JavaScript/Reference/Global objects/Intl/ListFormat/resolvedOptions
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
optionsargument 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
optionsargument of the constructor or the default value ("conjunction"). Its value is either"conjunction","disjunction", or"unit".
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 |
|---|
| Intl.ListFormatThe definition of 'resolvedOptions()' in that specification. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Chrome
Full support 72 |
Edge
No support No |
Firefox
Full support 78 |
IE
No support No |
Opera
Full support 60 |
Safari
No support No |
WebView Android
Full support 72 |
Chrome Android
Full support 72 |
Firefox Android
No support No |
Opera Android
Full support 51 |
Safari iOS
No support No |
Samsung Internet Android
No support No |
nodejs Full support 12.0.0 Full support 12.0.0 Notes' Before version 13.0.0, only the locale data for |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.'
- Experimental. Expect behavior to change in the future.
- See implementation notes.'
- See implementation notes.
See also
Intl.ListFormatIntl.NumberFormat.prototype.resolvedOptions()Intl.Collator.prototype.resolvedOptions()Intl.DateTimeFormat.prototype.resolvedOptions()Intl.PluralRules.prototype.resolvedOptions()
Intl .List Format .prototype .resolvedOptions() by Mozilla Contributors is licensed under CC-BY-SA 2.5.