Created
April 14, 2021 12:24
-
-
Save jz222/2c47586f4816b9524a27670fed913f4e to your computer and use it in GitHub Desktop.
A function that returns the flag emoji for a given country code.
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
| const getFlag = (countryCode) => String.fromCodePoint(...[...countryCode.toUpperCase()].map(x => 0x1f1a5 + x.charCodeAt())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment