// start with new or original interval, stop current interval this.reset = function(newT = t) { t = newT; return this.stop().start(); } } code example
Example: how to reset interval javascript
function myFn() {console.log('idle');}
var myTimer = setInterval(myFn, 4000);
// Then, later at some future time,
// to restart a new 4 second interval starting at this exact moment in time
clearInterval(myTimer);
myTimer = setInterval(myFn, 4000);