Mobile-first solution using Sass,Flexbox and Parcel
Design comparison
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
- @Mod8124Posted about 2 years ago
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 youasync and await
always usetry 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 helpful1@Kaipi01Posted about 2 years ago@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 GitHubJoin 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