For loops not working as expected in Postman

Hello,

Im using postman and need for loops in both pre-scripts and tests. This is because responses are changing a lot, and they’re SOAP XML. Anyway, i use for loops but they dont work as they dont loop.

See screenshot, the loop will only print out 0, and not the following integers. Is this a bug or what am i experiencing here?