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 async keyword do when applied to a function?

View

What does the await keyword do in an async function?

View

Which of the following is true about using await?

View

What does an async function always return?

View

What will happen if you omit await inside an async function?

View

How can you handle errors in an async function?

View

Which of the following can be used with the await keyword?

View

What is a common benefit of using async/await over .then() chaining?

View

How do you handle multiple promises with async/await?

View

What will happen if you use await on a rejected promise without a try...catch block?

View

What does the async keyword do when applied to a function?

It converts the function into an asynchronous function that always returns a Promise
It delays the function execution
It makes the function execute in a separate thread
It pauses the function execution

What does the await keyword do in an async function?

It pauses the execution of the function until the promise is resolved or rejected.
It converts the promise into a synchronous function.
It handles errors in the function.
It makes the function execute faster.

Which of the following is true about using await?

await can only be used inside async functions.
await works in both synchronous and asynchronous functions.
await can only be used with callback functions.
await is used to reject promises.

What does an async function always return?

A promise
A resolved value
Undefined
A callback function

What will happen if you omit await inside an async function?

The code will execute normally, but the promise will not be awaited.
The code will throw a syntax error.
The promise will automatically resolve.
The function will become synchronous.

How can you handle errors in an async function?

Using a try...catch block.
By using the await keyword.
By chaining .then() and .catch().
By using Promise.all()

Which of the following can be used with the await keyword?

A promise
A synchronous function
An event listener
A callback function

What is a common benefit of using async/await over .then() chaining?

The code becomes easier to read and maintain.
It makes the code faster
It converts all promises into synchronous code
It eliminates the need for error handling

How do you handle multiple promises with async/await?

Use Promise.all() and await the result.
Use await with multiple promises in one function.
Use setTimeout() with async/await.
Use multiple await statements in a loop.

What will happen if you use await on a rejected promise without a try...catch block?

The function will throw an error and stop execution
The function will log the error but continue executing
The function will automatically retry the promise
Nothing happens; the error is ignored