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 is a Promise in JavaScript?

View

Which method is used to handle the fulfilled state of a Promise?

View

Which of the following is used to handle a rejected Promise?

View

What does the Promise.resolve() method do?

View

What happens if you call then() without a second argument?

View

Which of the following is true about Promises?

View

What is returned by a then() method in a chain of promises?

View

What is the state of a newly created Promise?

View

How do you chain multiple promises together?

View

Which method is used to execute code regardless of the promise being resolved or rejected?

View

What is a Promise in JavaScript?

A function that executes code asynchronously
A special object that represents a value that may be available now, or in the future, or never
A method to call a function after a set interval
A callback function

Which method is used to handle the fulfilled state of a Promise?

catch()
resolve()
then()
finally()

Which of the following is used to handle a rejected Promise?

finally()
then()
resolve()
catch()

What does the Promise.resolve() method do?

Rejects a promise
Creates a promise that is already resolved
Waits for all promises to resolve
Creates a new promise that will resolve later

What happens if you call then() without a second argument?

The promise is rejected
The error will not be caught
The rejection is ignored
The promise is still resolved but no error handling occurs

Which of the following is true about Promises?

A Promise can only have one then() method
Promises are synchronous
Once a Promise is settled, its state cannot change
Promises can only be resolved or rejected after all code is executed

What is returned by a then() method in a chain of promises?

A new promise
A resolved value
The original promise
Nothing

What is the state of a newly created Promise?

Resolved
Rejected
Pending
Fulfilled

How do you chain multiple promises together?

By passing a new promise to catch()
By calling resolve() in the callback function
By using multiple then() methods
By calling the promises in a loop

Which method is used to execute code regardless of the promise being resolved or rejected?

then()
finally()
catch()
Promise.all()