What does the resolve function do in a JavaScript Promise?

  • It is called when an error occurs.
  • It is called when the Promise is rejected.
  • It is called when the Promise is fulfilled with a value.
  • It is called to cancel the Promise.
The resolve function in a JavaScript Promise is called when the Promise is fulfilled successfully with a value. It signifies that the asynchronous operation inside the Promise has completed successfully, and the value provided in the resolve function is the result.
Add your answer
Loading...

Leave a comment

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