countries関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Every country: the 249 ISO 3166-1 codes and Kosovo (XK). order: "en" sorts by the English name folded
(accents and case set aside); order: "ja" by the Japanese name in kana, its reading where it is written in
kanji, in plain kana order (not a full Japanese collation).
インポート
import { countries } from "@johnmorrisdotca/kuni";
定義
function countries(options?: CountriesOptions): readonly Country[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
options (省略可) | CountriesOptions |
|
戻り値
readonly Country[]
The 250 countries, the list and its objects frozen and shared.
例
import { countries } from "@johnmorrisdotca/kuni";
console.log(countries().length); // 250
console.log(countries({ order: "en" })[0].name.en); // "Afghanistan"
console.log(countries({ order: "ja" })[0].name.ja); // "アイスランド"250
Afghanistan
アイスランド出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。