This is the best example to handle async operations parallel in Nodejs. In this example, we have used the promises primitive datatype of javascript to parallel call while async operation. If you execute this script then output come after 3 seconds.
if check-in script apifirst take 2 seconds in execution and apiSecond take 3 seconds if you use the computer language like synchronized operation process to execute then it takes 2 + 3 = 5 seconds to execute output but in the case of NodeJs it only takes 3 seconds.
Top comments (1)
nodejs