When using await inside a function, what does the function return?

  • It returns the resolved value of the awaited Promise.
  • It returns a boolean indicating if the Promise is pending.
  • It returns an array of all pending Promises.
  • It returns an error if the Promise is rejected.
When you use await inside an async function, the function returns the resolved value of the awaited Promise. This enables you to work with asynchronous code in a more synchronous style.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *