break settimeout loop within itself javascript code example
Example: break loop timeout javascript
var keepCalling = true;
setTimeout(function () {
keepCalling = false;
}, 10000);
while ( keepCalling ) {
// do something
}
var keepCalling = true;
setTimeout(function () {
keepCalling = false;
}, 10000);
while ( keepCalling ) {
// do something
}