What will happen if Await keyword is not used?
For further actions, you may consider blocking this person and/or reporting abuse
What will happen if Await keyword is not used?
For further actions, you may consider blocking this person and/or reporting abuse
Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.
kathir b -
Aviral Srivastava -
GitHubOpenSource -
정유준 -
Top comments (4)
If you don't await the specific task, the async response is lost. If you await the task, its async response is fetched properly. As a best practice, you should always await the async calls.
What about the code which is written inside Async keyword? Will it run accordingly, the way it was running when using async & await keyword?
Yes, It'll execute line by line. But for instance, if you want to execute more than 2 async calls(Like you want two or more await keywords to be used in 1 async function), then it may vary with respect to processing and computation. The best is to use Promise.All to execute multiple async calls line by line.
Example:
Promise.all([promise1, promise2, promise3])
Thanks Brother