Reference · Country and region names
flagEmojifunction
A flag as an emoji: a country's two regional-indicator letters, or the tag sequence for England, Scotland or Wales. A subdivision, a former country, and Northern Ireland have none.
Import it
import { flagEmoji } from "@johnmorrisdotca/hata/names";
Definition
function flagEmoji(code: string): string | null
Parameters
| Name | Type | Description |
|---|---|---|
code | string | A flag's code, a name, or another code |
Returns
string | null
The emoji, or null when the place has no flag emoji here.
Examples
import { flagEmoji } from "@johnmorrisdotca/hata/names";
console.log(flagEmoji("JP")); // "🇯🇵"
console.log(flagEmoji("GB-SCT")); // the Scotland tag sequence
console.log(flagEmoji("JP-13")); // null🇯🇵
🏴
nullWhat it prints (run when this page was built)