Code:
var interval = setInterval(function () { //Some code1 if(w > 100) { clearInterval(interval); } }, 10) //Some code2 var interval3 = setInterval(function () { //Some code3 if(left2 > 1 && o2 != 1) { clearInterval(interval3); } }, 10)
In this case, the actions are performed in the following order:
- code1
- code2
- code3
- code1
- code2
- code3
- code1
- code2
- code3
etc.
And I need:
- code1
- code1
- code1
- code2
- code2
- code2
- code3
- code3
- code3
How to achieve this?