Skip to content

Instantly share code, notes, and snippets.

@yukulele
Created December 16, 2021 14:49
Show Gist options
  • 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