Answer the question
In order to leave comments, you need to log in
How to wait for setTimeout to complete in Node.JS?
There is such a problem:
var venFirst = 0;
setTimeout(function(){
venFirst = 1;
}, 9999999999)
console.log(venFirst);
Answer the question
In order to leave comments, you need to log in
The most correct option is to put "everything below the timeout" inside the callback function.
And read more about Node.js asynchrony - the differences in the application architecture from the same php are simply gigantic.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question