Skip to content

Solution#1552

Open
Denixify wants to merge 1 commit into
mate-academy:masterfrom
Denixify:develop
Open

Solution#1552
Denixify wants to merge 1 commit into
mate-academy:masterfrom
Denixify:develop

Conversation

@Denixify

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants