hello there, my first day here, I have a function that contains a loop that calls another function but each iteration completes without waiting for the inner function to complete.
function run()
{
for(var x = 0; x < 10; x++)
{
update_some_stuff(); ///the iteration aren't waiting for this to complete
}
}
I have tried using setTimeOut but it’s workings I don’t understand, how can I force the iteration to wait for the function update_some_stuff() to complete,
```update_some_stuff()`` : open a link[the contents of this link changes alot] get an inventory,
got back to the previous url use the inventory, save the details of the inventory.
the loop iterations aren’t waiting for the function to complete a single call, the function update_some_stuff seems not to block the loop am not sure why.