Created
April 9, 2021 23:49
-
-
Save dougg0k/3f9ca6f903291aada371628391f927b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getCountryFlagEmoji = countryCode => String.fromCodePoint(...[...countryCode.toUpperCase()].map(x => 0x1f1a5+x.charCodeAt(0))) | |
getFlagEmoji('GB') // 🇬🇧 | |
getFlagEmoji('JP') // 🇯🇵 | |
getFlagEmoji('ZA') // 🇿🇦 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment