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 required behaviors: you created two promises, one that resolves when the .logo element is clicked and another that rejects after 3 seconds, and both success/error handlers append the correct <div> messages directly to document.body. Functionally, this matches the task specification, including the exact success and error text and the proper class names on the created elements.
One thing to be aware of (not a blocker for this task) is that document.querySelector('.logo') can return null if the element doesn’t exist or the script runs before the DOM is ready; calling addEventListener on null would then throw a runtime error. In a real project, you could harden this by either wrapping your logic in a DOMContentLoaded listener or by checking if (logo) { logo.addEventListener(...) }. As a minor improvement, using element.classList.add('message', 'error-message') instead of assigning className directly would make it easier to extend styling later without overwriting existing classes. Overall, your promises and DOM updates are implemented cleanly and fulfill the task requirements well—nice work.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.