Reference · Places: countries of a continent, and search (the size counts every tier)
countriesOffunction
The countries of a continent, from kuni's groupings (the seven continents), in alpha-2 order.
Import it
import { countriesOf } from "@johnmorrisdotca/kuni/places";
Definition
function countriesOf(continent: string): readonly Country[]
Parameters
| Name | Type | Description |
|---|---|---|
continent | string | "AF", "AN", "AS", "EU", "NA", "OC" or "SA", in either case. |
Returns
readonly Country[]
The countries, frozen; an empty list for a code that is not a continent.
Examples
import { countriesOf } from "@johnmorrisdotca/kuni/places";
console.log(countriesOf("OC").map((one) => one.alpha2).includes("AU")); // true
console.log(countriesOf("eu").some((one) => one.alpha2 === "FR")); // true
console.log(countriesOf("XX").length); // 0true
true
0What it prints (run when this page was built)