Created
February 11, 2024 12:54
-
-
Save remy727/968e466a6c61bf636f54aeb91650b28e to your computer and use it in GitHub Desktop.
Get Country name from Country code using JavaScript
This file contains 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 regionNames = new Intl.DisplayNames( | |
['en'], {type: 'region'} | |
); | |
console.log(regionNames.of('US')); // ๐๏ธ "United States" | |
console.log(regionNames.of('GB')); // ๐๏ธ "United kingdom" | |
console.log(regionNames.of('DE')); // ๐๏ธ "Germany" | |
console.log(regionNames.of('AU')); // ๐๏ธ "Australia" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how do i get dial code from isoAlpha2Code, isoAlpha3Code?? in typescript using built in functions