Created
January 8, 2022 14:49
-
-
Save carlovsk/a9a18629f4e0a87aa04c294c141b0741 to your computer and use it in GitHub Desktop.
Country Code to Flag Emoji
This file contains hidden or 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 getFlagEmoji = countryCode => { | |
const codePoints = countryCode | |
.toUpperCase() | |
.split('') | |
.map(char => 127397 + char.charCodeAt()); | |
return String.fromCodePoint(...codePoints); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code got from here. I have created the gist just to save it.