Promise
Promise
INTERVIEW QUESTION-139
Follow on
@Duvvuru Kishore
In asynchronous JavaScript, promises are
crucial for handling tasks that take time to
complete, like server requests.
What is a Promise?
async Function:
Declares a function that returns a promise.
await Keyword:
Pauses the execution of the async function,
waiting for the promise to resolve or reject.
async/await example
Mastering promises and async/await is crucial for
modern web development. They enable you to
handle asynchronous operations effectively,
improving code readability and maintainability.