Reference · Countries and lookup tools
continentNamefunction
A continent's name, from CLDR.
Import it
import { continentName } from "@johnmorrisdotca/kuni";
Definition
function continentName(continent: Continent, language?: Language): string | null
Parameters
| Name | Type | Description |
|---|---|---|
continent | "AF" | "AS" | "NA" | "SA" | "AN" | "EU" | "OC" | One of the seven two-letter continents. |
language (optional) | "en" | "ja" | "en" (the default) or "ja". |
Returns
string | null
The name; null for anything that is not one of the seven.
Examples
import { continentName } from "@johnmorrisdotca/kuni";
console.log(continentName("AS")); // "Asia"
console.log(continentName("AS", "ja")); // "アジア"Asia
アジアWhat it prints (run when this page was built)