Solution#1552
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because it correctly implements all of the required promise behavior and DOM updates. You created two promises (promise1 and promise2), resolved the first one on .logo click, and rejected the second one after 3 seconds with setTimeout(..., 3000), exactly as specified. Both promises have proper .then and .catch handlers, and the success and error handlers append the correct <div> elements with the required classes and exact texts ("Promise was resolved!" and "Promise was rejected!") to the body. The showMessage helper is a nice touch that avoids duplication and keeps the DOM manipulation clear and maintainable.
One small non-blocking improvement would be to guard against a missing .logo element (e.g., checking that document.querySelector('.logo') is not null before adding the event listener) to avoid potential runtime errors in different HTML setups. Overall, your code meets the functional requirements cleanly and should behave as expected for this task. Well done on implementing the promises and handlers in a clear and straightforward way.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK