Ask Your Question
4

Is it possible that async/await is not functioning properly with map or for loop when using JavaScript?

asked 2023-05-09 23:31:25 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-05-09 23:41:01 +0000

david gravatar image

No, async/await functions work properly with map or for loop in JavaScript. When using async/await with map or for loop, each iteration waits for the previous iteration to complete before starting the next one. This ensures that the results are processed in sequence and the program does not continue until all the promises have resolved or rejected. However, it's important to correctly handle any errors that may occur during the process, as this could cause unexpected behavior.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-09 23:31:25 +0000

Seen: 8 times

Last updated: May 09 '23