Design comparison
Solution retrospective
- Create the quiz logic using multiple event listeners and async functions.
- have better planning organize the code
- Using Event Listeners to account different states.
- Best practices in writing Code.
Community feedback
- @HexersePosted 4 months ago
No feedback. Instead I am learning a lot from your code.
0@prem-kumartPosted 4 months ago@Hexerse Thank you! but this is an ad-hoc version that I made. Naming is not consistent. I have used async/await and went on from there Used "Promises" to wait for an action and resolved accordingly. Creating dynamic elements and inserting them as needed.
Please do reply if you found another way of doing it or anything to improve my code.
0@HexersePosted 4 months ago@prem-kumart to be honest i am exploring async await. I was wondering if you put the fetch into a function or put fetch into a function and await it. Then you wouldn’t need to put await on so many functions? I have no time to test it now but its an idea maybe you could try ?
async function fetchData (url) { try { const response = await fetch(url);
const json = await response.json();
console.log(json);
} catch (error) { console.error(
Error : ${error}
); } }0@prem-kumartPosted 4 months ago@Hexerse I looked into it this way. I have a series of await functions
- Loading the Welcome Page ( wait for the response - selecting the subject ) ---->then 2. Each Question ( wait for the response - answer) -> 3. Final Score ( wait for the response ) ---- repeat the process
0@HexersePosted 3 months ago@prem-kumart I see, have you tried posting into the discord channels ? I think they can help a lor more
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