js_promise_basic_DOM#1556
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved because it correctly implements all the required promise behavior and DOM updates. You created both promise1 and promise2, resolved promise1 on a .logo click, and rejected promise2 after 3 seconds, all in line with the task description. Both promises have proper then and catch handlers, and your success and error handlers append the correct <div class="message"> and <div class="message error-message"> elements with the required texts to the document body. There are no critical or blocking functional issues in the provided src/scripts/main.js file relative to the stated requirements. As minor improvements (not required for this task), you could use a more descriptive error message than new Error('err') and optionally guard against the .logo element being missing to avoid runtime errors if the HTML changes. Also remember to follow the checklist items outside the code: substitute your GitHub username in the demo link in the README and run the specified npm test commands. Overall, nice job meeting the core requirements and keeping the implementation clear and straightforward.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
First promises
Create 2 promises
promise1andpromise2.promise1should be resolved on aclickon.logo.promise2promise should be rejected in 3 seconds.<div class="message">with the textPromise was resolved!to the body<div class="message error-message">with the textPromise was rejected!to the bodyInstructions
<142536Def>with your Github username in the linknpm run testcommand to test your code;npm run test:only -- -nto run fast test ignoring linter;npm run test:only -- -lto run fast test with additional info in console ignoring linter.