Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

340
Views
Get country name from ISO code in Javascript

Having the list of country ISO codes, they are available here for reference:

Is there a way to return the country name from it?

Like, having a function, getCountryName(), which if called getCountryName('AL') will return 'Albania' and so on.

I was doing it as saving the whole list and work on it as with a dictionary but I was wondering if there is a method without saving the whole countries into a list.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can try Intl.DisplayNames() of ECMAScript Internationalization API Intl:

var getCountryNames = new Intl.DisplayNames(['en'], {type: 'region'});
console.log(getCountryNames.of('AL'));  // "Albania"

about 4 years ago · Juan Pablo Isaza Report

0

Hei you could use the JSON version of what you need, here https://pkgstore.datahub.io/core/country-list/data_json/data/8c458f2d15d9f2119654b29ede6e45b8/data_json.json

then, with a forach, you loop over the file, with your ISO code, and when you find it, you ask your script to return the state name

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!