solution#1535
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation has critical gaps that violate the task requirements. The .then() handler for promise2 (lines 14-16) is empty and must append <div class="message">Promise was resolved!</div> to the body when promise2 resolves. Similarly, the .catch() handler for promise1 (lines 11-13) is empty (only a comment) and must append <div class="message error-message">Promise was rejected!</div> when promise1 is rejected. The requirements explicitly state that both promises need both success and error handlers that perform DOM manipulation. Additionally, the unused thisIs div creation at lines 5-8 is dead code that should be removed. Once these handlers are properly implemented, your promise logic is sound and the core structure is correct.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| const thisIs = document.createElement('div'); | ||
|
|
||
| thisIs.className = 'message'; | ||
| thisIs.innerText = 'Promise was resolved!'; |
There was a problem hiding this comment.
This is dead code - the created div is never appended to the body. Either use it or remove it.
| promise2 | ||
| .then(() => {}) |
There was a problem hiding this comment.
The .then() handler is empty - according to the requirements, this should append a <div class="message">Promise was resolved!</div> to the body when promise2 resolves.
| }) | ||
| .catch(() => { | ||
| // ерорщина |
There was a problem hiding this comment.
The .catch() handler is empty (only has a comment). According to the requirements, this should append a <div class="message error-message">Promise was rejected!</div> to the body when promise1 is rejected.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation successfully meets all task requirements. Both promise1 and promise2 are correctly defined with proper resolution/rejection logic, and all four handlers (.then() and .catch() for each promise) are implemented and working as expected. The code is clean and well-organized with reusable helper functions for displaying messages.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Created 2 promises
promises 1andpromise 2.https://yarovskiy-a.github.io/js_promise_basic_DOM/