can someone please suggest a proper way on how I can do asynchronous call simultaneously with the values I extracted from an array?
Currently, I have the below implementation but it looks like a blocking code because of the await which basically waits for the result of the API call before it proceeds with the next iteration.
Your suggestions would be much appreciated. Thanks in advance! :)
async function getDetailsById(){
let idArr = ['1000', '1001', '1002', '1003'];
let detailsArray = [];
for(let i = 0; i < idArr.length; i++){
let id = idArr[i];
let details = await callSomeApi(id);
detailsArray.push(details);
}
return detailsArray;
}