Skip to content

Instantly share code, notes, and snippets.

@digizeph
Created October 5, 2022 17:32
Show Gist options
  • Select an option

  • Save digizeph/0013e5c61d9de06d27fc021ac0776ac7 to your computer and use it in GitHub Desktop.

Select an option

Save digizeph/0013e5c61d9de06d27fc021ac0776ac7 to your computer and use it in GitHub Desktop.

Revisions

  1. digizeph created this gist Oct 5, 2022.
    7 changes: 7 additions & 0 deletions country-to-emoji.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    function getFlagEmoji(countryCode) {
    const codePoints = countryCode
    .toUpperCase()
    .split('')
    .map(char => 127397 + char.charCodeAt());
    return String.fromCodePoint(...codePoints);
    }