Answer the question
In order to leave comments, you need to log in
console.log() synchronization
There is a code:
(In the loop, the xml file is read, parsed, information is obtained from certain blocks, and then, using RegExp, the search for certain sentences)
var tempNumber = 0;
for (i=0; i < 3; i++) {
<...>
tempNumber++;
<...>
}
console.log("tempNumber: " + tempNumber);
var tempNumber = 0;
for (i=0; i < 3; i++) {
tempNumber++;
}
console.log("tempNumber: " + tempNumber);
Answer the question
In order to leave comments, you need to log in
At the risk of "meditating": in your <...> the same variable tempNumber changes ...
1. You simply change the value of a variable somewhere in the body of the loop back to zero.
2. You use defered, setTimeout, or other tricks to distribute the flow of execution. Which causes the log to fire faster than the processing of the loop body.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question