Created
May 13, 2021 09:48
-
-
Save duzun/4ec5b68fdc3a573eaf5298db6c0968c3 to your computer and use it in GitHub Desktop.
get-country-flag
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
function getFlag(country_code) { | |
// just some unicode magic | |
return String.fromCodePoint(...Array.from(country_code||"") | |
.map(c => 127397 + c.codePointAt())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
country-code-emoji