Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

REST Countries API with color theme switcher

@VincenzoMarcovecchio

Desktop design screenshot for the REST Countries API with color theme switcher coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
4advanced
View challenge

Design comparison


SolutionDesign

Solution retrospective


I have worked on this project with the help of the Youtuber Florin Pop, i have a general idea of what working with api's is, async functions, and embedding in es6.

One question: When you want to display the borders countries(using .borders property) the api gives you back some three letter abbreviation of the full name, how can i turn that into the full name, any help?

Thank you

Community feedback

@VincenzoMarcovecchio

Posted

countries = is my res.json() how can i filter from that for each of those alpha 3 code thank you i'm on the tutorials anyway :)...

0

@VincenzoMarcovecchio

Posted

I'm trying to create a function i know i'm really bad at it :)

const borders = country.borders; const fullName = for(let border of borders){ let name = border.name //i know this is wrong return name });

0

gomezlucas• 1,115

@gomezlucas

Posted

@vinceoldmark I kind of understand what you are trying to achieve. you get inside country borders an Array with the codes of those countries. Let's say [arg, col, bra]. So border.name is going to be undefined since that information is not in country. So you either keep an array with the countries-object and filter from it. Or do "fetches" asking for the codes you have inside that array. Hope it make sense. Ask me again otherwise :)

1
umutbozdag• 130

@umutbozdag

Posted

You have to fetch those letters from api like this: https://restcountries.eu/rest/v2/alpha/COL and then get the actual names of those countries

0

umutbozdag• 130

@umutbozdag

Posted

@umutbozdag Or maybe you could filter the array depending the country code.

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord