for (i = 0; i < 100; i++) {
botManager();
};
only executes once
botManager();
botManager();
botManager();
but this executes 3 times. I'm baffled. I've tried debugging with console.log and debugger; but to no avail. What are common solutions?
Give scope to loop variables
for(let i = 0; i < 100; i++)
Everywhere you are using for loops. Or better yet use 'use strict' at start of page.
Because if you have other(s) for loops that use i in the functions that are being called inside the main for loop, then that could be causing problems.
i, that is a different matter. But we can't possibly know that from the code shown in the question.let should be taken into account.
ito 3 and try to step through your codeforloop will just break if the nested functions haven't finished their job by the timebotManager()is called again by theforloop (which is 1 ms)