How to wait for multiple asynchronous calls from for loop?
问题 Code without any handling: for (i=0; i<dbImgCount; i++){ (function(i) { imgDownload(FolderPath[i].FolderPath, function (next){ var url = FolderPath[i].FolderPath; const img2 = cv.imread(imgDownload.Filename); match({url, img1, img2, detector: new cv.ORBDetector(), matchFunc: cv.matchBruteForceHamming, }); }) })(i); } In the above code, imgDownload is an async function which will download image, match will match features of downloaded image with another image. Need to execute a function after