Intl.Segmenter.prototype.resolvedOptions()
Intl.Segmenter 实例的 resolvedOptions() 方法返回一个新对象,其属性反映了在此 Intl.Segmenter 对象初始化期间计算的区域设置和粒度选项。
¥The resolvedOptions() method of Intl.Segmenter instances returns a new object with properties reflecting the locale and granularity options computed during the initialization of this Intl.Segmenter object.
Try it
语法
参数
返回值
¥Return value
一个新对象,其属性反映在给定 Intl.Segmenter 对象初始化期间计算的区域设置和排序规则选项。
¥A new object with properties reflecting the locale and collation options computed
during the initialization of the given Intl.Segmenter object.
描述
¥Description
生成的对象具有以下属性:
¥The resulting object has the following properties:
locale-
实际使用的区域设置的 BCP 47 语言标记。如果在导致此区域设置的输入 BCP 47 语言标记中请求了任何 Unicode 扩展值,则此区域设置所请求和支持的键值对将包含在
locale中。 granularity-
在
options参数中为此属性提供的值或作为默认值填写。
示例
基本用法
默认粒度
后备区域设置
规范
| Specification |
|---|
| ECMAScript Internationalization API Specification # sec-intl.segmenter.prototype.resolvedoptions |
浏览器兼容性
BCD tables only load in the browser
¥Browser compatibility