Last active
October 12, 2019 10:19
-
-
Save fa7ad/22d70e938aa74fb79cca64c83178f1e4 to your computer and use it in GitHub Desktop.
ISO Country code to Emoji Flag
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
function countryToEmoji (code) { | |
code = code.toUpperCase() | |
const [e1, e2] = [code.codePointAt(0) + 127397, code.codePointAt(1) + 127397] | |
return String.fromCodePoint(e1) + String.fromCodePoint(e2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment