JavaScript

Intl.ListFormat.prototype.resolvedOptions() メソッド


編集:2023.01.10 by T.A.

[Edge]。→

Intl.ListFormat でのリストの書式化に計算されたプロパティを持つ新しいオブジェクトを返します。

構文
Intl.ListFormat.resolvedOptions()
Intl.ListFormat Intl.ListFormat
戻り値

以下のプロパティを持つオブジェクト。

プロパティと値:
locale
言語コード。言語タグ

値例:「ja」

type
リスト化の種類。→Intl.ListFormat():type

値例: 「disjunction」

style
リスト化のスタイル。→Intl.ListFormat():style

値例: 「long」

DA=new Intl.ListFormat('ja');  //日本語。
D=DA.resolvedOptions();  //=[object]:[object Object]
	//locale=[string]:ja
	//type=[string]:conjunction
	//style=[string]:long
DA=new Intl.ListFormat('en');  //英語。
D=DA.resolvedOptions();  //=[object]:[object Object]
	//locale=[string]:en
	//type=[string]:conjunction
	//style=[string]:long
DA=new Intl.ListFormat('ja', {type:'disjunction', localeMatcher:'lookup'});  //日本語、リスト化の種類、マッチングアルゴリズム。
D=DA.resolvedOptions();  //=[object]:[object Object]
	//locale=[string]:ja
	//type=[string]:disjunction
	//style=[string]:long

Intl.ListFormat()Intl.ListFormat.format()


テスト