loop through it to get the first item and do an ajax call then when I get a response I would get the second item of the given array and so on
How could I do that?
I just used foreach to loop through the item but I could not delay the next itme till I got the response of the previous
You need to learn about async programming
Use Array.map to transform every item of the array into a promise
Обсуждают сегодня