Skip to content

Instantly share code, notes, and snippets.

@duzun
Created May 13, 2021 09:48
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 duzun/4ec5b68fdc3a573eaf5298db6c0968c3 to your computer and use it in GitHub Desktop.
Save duzun/4ec5b68fdc3a573eaf5298db6c0968c3 to your computer and use it in GitHub Desktop.
get-country-flag
function getFlag(country_code) {
// just some unicode magic
return String.fromCodePoint(...Array.from(country_code||"")
.map(c => 127397 + c.codePointAt()));
}
@duzun
Copy link
Author

duzun commented May 13, 2021

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