For example:
var soma = 0;
for(var i = 0; i < 100; i++){
soma += i;
}
if(soma < 500){
console.log('Soma é menor que 500');
}
Since the if
condition depends on the variable b
, which comes from the for loop, the if
conditional will only be executed when the loop for
is complete, or do I have to put if
on some kind of callback?
In short: I want to know if the browser "skips" for
before it finishes, or if I can trust that the function / statement below for
will only run when it is completed .