Suppose I have two lines of code, code1 and code2, of which both are very fast-runned:
$(function(){
var flag=0
var fistElement=$("#someHTML");
var secondElement=$("#someOtherHTML");
fisrtElement.append(secondElement); //code1
flag=1 //code2
})
Since both lines of codes(code1 and code2) I would assume could be finished instantly, is there probabilities that the flag update(code2) finished before the html update(code2)? Although normally when I test it with a few examples, the code1 always finished before the code2.