Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What does the Promise.all() method do?

View

In Promise.all(), if one promise is rejected, what happens to the other promises?

View

What does the Promise.race() method return?

View

What will Promise.resolve(Promise.reject('Error')) return?

View

What happens when a Promise is rejected but no catch() method is used?

View

Can a Promise be rejected after it has been resolved?

View

What does the Promise.allSettled() method do?

View

In the Promise constructor, which function is responsible for rejecting a promise?

View

What does the Promise.prototype.finally() method do?

View

How can you handle multiple promises that need to complete but you don’t care if some reject?

View

What does the Promise.all() method do?

Resolves a promise after a timeout
Rejects all promises if one is rejected
Waits for all promises to resolve or reject
Chains multiple promises in a sequence

In Promise.all(), if one promise is rejected, what happens to the other promises?

They continue to resolve
They all reject immediately
They are converted into synchronous functions
They are ignored

What does the Promise.race() method return?

The first fulfilled or rejected promise
All resolved promises
The slowest resolving promise
The fastest rejected promise

What will Promise.resolve(Promise.reject('Error')) return?

A rejected promise with 'Error'
A resolved promise
An error
Undefined

What happens when a Promise is rejected but no catch() method is used?

The promise will crash the program
The promise will be silently ignored
The rejection is handled by the next then()
A runtime error will occur

Can a Promise be rejected after it has been resolved?

Yes, only if no then() is used
Yes, but only within a finally() block
No, once settled, a promise cannot change states
Only if a timeout is set

What does the Promise.allSettled() method do?

Waits for all promises to resolve
Waits for all promises to either resolve or reject, and returns their states
Rejects all promises on first rejection
It combines multiple promises into a single promise

In the Promise constructor, which function is responsible for rejecting a promise?

resolve()
reject()
catch()
Promise.race()

What does the Promise.prototype.finally() method do?

It executes when a promise is resolved
It executes when a promise is rejected
It executes when a promise is settled (either resolved or rejected)
It cancels the promise

How can you handle multiple promises that need to complete but you don’t care if some reject?

Using Promise.all()
Using Promise.race()
Using Promise.allSettled()
Using then() and catch()