Created
October 5, 2022 17:32
-
-
Save digizeph/0013e5c61d9de06d27fc021ac0776ac7 to your computer and use it in GitHub Desktop.
Country code to emoji conversion function
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 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