I have the following loop:
for (let z = 0; z < searchArray.length; z++) {
searchFMG(searchArray[z])
}
Where searchFMG makes an api call (with axios) and processes the result.
The problem is that the api I need to connect to has a rate limit that I can make requests. So I tried changing it to:
setTimeout(searchFMG(searchArray[z], 1000)
which doesn't make calls for each value of z.
What is a way for me to slow down the loop or some way make these call one second apart?
Thank you