Intl.Collator.prototype.resolvedOptions()
method returns a new object with properties reflecting the locale and collation options computed during initialization of this
Collator
对象。
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
collator.resolvedOptions()
A new object with properties reflecting the locale and collation options computed during the initialization of the given
Collator
对象。
The resulting object has the following properties:
locale
locale
.
usage
sensitivity
ignorePunctuation
options
argument or filled in as defaults.
collation
"co"
, if it is supported for
locale
,或
"default"
.
numeric
caseFirst
options
argument or using the Unicode extension keys
"kn"
and
"kf"
or filled in as defaults. If the implementation does not support these properties, they are omitted.
resolvedOptions
方法
var de = new Intl.Collator('de', { sensitivity: 'base' })
var usedOptions = de.resolvedOptions();
usedOptions.locale; // "de"
usedOptions.usage; // "sort"
usedOptions.sensitivity; // "base"
usedOptions.ignorePunctuation; // false
usedOptions.collation; // "default"
usedOptions.numeric; // false
| 规范 |
|---|
|
ECMAScript 国际化 API (ECMA-402)
The definition of 'Intl.Collator.prototype.resolvedOptions' in that specification. |
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resolvedOptions
|
Chrome 24 | Edge 12 | Firefox 29 | IE 11 | Opera 15 | Safari 10 | WebView Android 4.4 | Chrome Android 25 | Firefox Android 56 | Opera Android 14 | Safari iOS 10 | Samsung Internet Android 1.5 |
nodejs
0.12
|
完整支持
见实现注意事项。
Intl
Collator
DateTimeFormat
ListFormat
NumberFormat
PluralRules
RelativeTimeFormat
Object
Object.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.toSource()
Object.prototype.toString()
Object.prototype.valueOf()
Object.setPrototypeOf()