Skip to content

Instantly share code, notes, and snippets.

@carlovsk
Created January 8, 2022 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlovsk/a9a18629f4e0a87aa04c294c141b0741 to your computer and use it in GitHub Desktop.
Save carlovsk/a9a18629f4e0a87aa04c294c141b0741 to your computer and use it in GitHub Desktop.
Country Code to Flag Emoji
const getFlagEmoji = countryCode => {
const codePoints = countryCode
.toUpperCase()
.split('')
.map(char => 127397 + char.charCodeAt());
return String.fromCodePoint(...codePoints);
}
@carlovsk
Copy link
Author

carlovsk commented Jan 8, 2022

Code got from here. I have created the gist just to save it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment