Advice Generator w/ Responsive Design - HTML, CSS, Vanilla JS

Please log in to post a comment
Log in with GitHubCommunity feedback
- @fazzaamiarso
Hello Justin!
Your use of API is good but redundant. You don't need to do async/await because you already resolve your promise with
then
. Also, it's better to stick with 1 method, either chaining withthen
orasync/await
So, here is the implementation:function getAdvice() { fetch(adviceAPI) .then(response => response.json()) .then(data => { quoteEl.textContent = `"${data.slip.advice}"`; adviceNumEl.textContent = data.slip.id; }) .catch(console.error); }
I hope it helps! Cheers!
Marked as helpful - Account deleted
Hello there! 👋
Congratulations on finishing your challenge! 🎉
I have some feedback on this solution:
-
put the quote inside a <blockquote> tag instead of div to be more semantic
-
check the HTML report to fix accessiblity issues
i hope this is helpful and goodluck!
Marked as helpful -
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