'Use variable out of array to resume in the same loop again

I'm trying to loop to 20k record in array, the problem is that the output of the response is only 200 lines. So I need to loop thru them to get all of them. Right now I managed to make a loop that 'loops' 100 times, but I need to parse the page number (and it's random strings) again in the request.

for (let i = 0; i < 100; i++) {

  var marker;

    const response = await client.request({
        "limit": 200,
        "marker": marker,
      })

    var marker = response['result']['marker']
}

But it's not parsing each time that value back in the request.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source