Skip to content

Instantly share code, notes, and snippets.

@fa7ad

fa7ad/countryToEmoji.js

Last active Oct 12, 2019
Embed
What would you like to do?
ISO Country code to Emoji Flag
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