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.
listFormat.resolvedOptions()
An object with properties reflecting the locale and formatting options computed during the construction of the given ListFormat
object.
The object returned by resolvedOptions()
has the following properties:
locale
locale
.style
options
argument of the constructor or the default value ("long"
). Its value is either "long"
, "short"
, or "narrow"
.type
options
argument of the constructor or the default value ("conjunction"
). Its value is either "conjunction"
, "disjunction"
, or "unit"
.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)
Desktop | ||||||
---|---|---|---|---|---|---|
resolvedOptions
|
72 | No | 78 | No | 60 | No |
Mobile | ||||||
---|---|---|---|---|---|---|
resolvedOptions
|
72 | 72 | No | 51 | No | No |
Server | |
---|---|
resolvedOptions
|
12.0.0
|
Intl.ListFormat
Intl.NumberFormat.prototype.resolvedOptions()
Intl.Collator.prototype.resolvedOptions()
Intl.DateTimeFormat.prototype.resolvedOptions()
Intl.PluralRules.prototype.resolvedOptions()
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions