Skip to content

Instantly share code, notes, and snippets.

@yukulele
Created December 16, 2021 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 yukulele/6d361642fcaa9848e142c93078b9c4e1 to your computer and use it in GitHub Desktop.
Save yukulele/6d361642fcaa9848e142c93078b9c4e1 to your computer and use it in GitHub Desktop.
Convert ISO 3166-1 alpha-2 country code to unicode flag char
unicodeFlag=countryCode=>countryCode.replace(/[a-z]/g,c=>String.fromCharCode(0xd83c,c.charCodeAt()+56709))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment