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

Mobile-first solution using Sass,Flexbox and Parcel

@Kaipi01

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


Hello, I just finished a challenge and therefore have a few questions. I would be very grateful if you would just give me an answer.

Is my code clear and legible? Are semmatics and HTML tags correct? Are there very bad code practices? Have you noticed any mistakes I haven’t seen? What could be changed to make the code run faster? Do I download the API data correctly?

Community feedback

Denis 1,060

@Mod8124

Posted

Hello Well done!

Your code is hard to read, first, always put all your variables on the top of the file especially if you use const to avoid hoisted also if you async and await always use try and catch what would happen if the API failed your app too so you need to handle that.

Also, it's kinda confusing what is this

    capital = [],
    languages = [],
    currencies = [],
    tld = [],
    borders = [];

And the first look Idk what are these variables, it's better to implement if you use this

const country = {
     capital = [],
    languages = [],
    currencies = [],
    tld = [],
    borders = [];
}

Now I Know all these variables are about the country, if you want to see more good practices and legible code you can see clean-code-javascript

I hope it helps you, Good coding 🤟

Marked as helpful

1

@Kaipi01

Posted

@Mod8124 I actually forgot error handling when retrieving API data 😅. Thank you very much for your comment. It’s very valuable to me. In the future, I will try to avoid these mitakes and try to write more readable 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