Closed bjaekel closed 4 years ago
FIxes error in setTimer and setInterval call in JavaScript. An example for the crash can be:
consolo.log('setting up a timer'); let timeoutId; timeoutId = setTimeout(function() { consolo.log('timeout executed, but calling clearTimeout()'); clearTimeout(timeoutId); consolo.log('after timeout executed.'); }, 1000);
consolo.log('setting up a timer'); let timeoutId; timeoutId = setInterval(function() { consolo.log('timeout executed, but calling clearTimeout()'); clearTimeout(timeoutId); consolo.log('after timeout executed.'); }, 1000);
Usefull information:
FIxes error in setTimer and setInterval call in JavaScript. An example for the crash can be:
consolo.log('setting up a timer'); let timeoutId; timeoutId = setTimeout(function() { consolo.log('timeout executed, but calling clearTimeout()'); clearTimeout(timeoutId); consolo.log('after timeout executed.'); }, 1000);
consolo.log('setting up a timer'); let timeoutId; timeoutId = setInterval(function() { consolo.log('timeout executed, but calling clearTimeout()'); clearTimeout(timeoutId); consolo.log('after timeout executed.'); }, 1000);
Usefull information: