Skip to content

js_promise_basic_DOM#1556

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

js_promise_basic_DOM#1556
142536Def wants to merge 1 commit into
mate-academy:masterfrom
142536Def:develop

Conversation

@142536Def

Copy link
Copy Markdown

First promises

Create 2 promises promise1 and promise2.

  • promise1 should be resolved on a click on .logo.
  • promise2 promise should be rejected in 3 seconds.
  • add success and error handlers for both promises
  • success handler should append a <div class="message"> with the text Promise was resolved! to the body
  • error handler should append a <div class="message error-message"> with the text Promise was rejected! to the body

Instructions

  1. Replace <142536Def> with your Github username in the link
  2. Follow this instructions
    • Run npm run test command to test your code;
    • Run npm run test:only -- -n to run fast test ignoring linter;
    • Run npm run test:only -- -l to run fast test with additional info in console ignoring linter.

@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

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

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