Responsive time tracking app - .json, javascript, css, html
Design comparison
Solution retrospective
~ First time using .json or dynamically populating and updating the DOM.
~ I'm finding grid increasingly comfortable to use, practise practise!
~ I was able to practise switch statements in there too.
What challenges did you encounter, and how did you overcome them?~ I found it challenging using the fetch API and functions to update the DOM.
What specific areas of your project would you like help with?~ Any advice on making the .json manipulation more efficient or more understandable for others reviewing code.
~ Any other advice or feedback is greatly appreciated!
Community feedback
- @alekseibodeevPosted 2 months ago
Hi 👋 Perfect solution!
If you want to improve readability of asynchronous code I would recommend to check async/await syntax out. async/await is syntactic sugar on top of promises that makes your code feels like a synchronous one. For example:
Promises:
fetch(url) .then((res) => res.json()) .then((data) => console.log(data)) .catch((err) => console.log(err));
async/await:
async function doStuff() { try { const res = await fetch(url); const data = await res.json(); console.log(data); } catch(err) { console.log(err); } } doStuff();
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