I'm getting some (to me) unexpected behavior with this code:
setInterval(function() {
console.log('Interval running');
setTimeout(function() {
console.log('TimeOut called');
}, 5000);
}, 2000);
setInterval is running fine (every 2 seconds), but setTimeout runs fine only first time (after 5 seconds) and after that it's starts running after 2 seconds also? :/
What am I missing here?