Skip to content

Instantly share code, notes, and snippets.

View kytta's full-sized avatar

Nikita Karamov kytta

View GitHub Profile
@kytta
kytta / emojiFlag.js
Created March 18, 2024 11:24
Get the emoji flag for an ISO-3166-1 alpha-2 country code.
/**
* Return the emoji flag for an ISO-3166-1 alpha-2 country code.
*
* The ISO code should be a string consisting of two latin characters
* (case-insensitive). Note that this method *does not* check the validity
* of the provided ISO code.
*
* @param {string} isoCode
* ISO-3166-1 alpha-2 country code
* @return {string} the emoji of the country's flag