cancel settimeout

JavaScript
var myVar;

function myFunction() {
  myVar = setTimeout(function(){ alert("Hello"); }, 3000);
}

function myStopFunction() {
  clearTimeout(myVar);
}var timer1 = setTimeout(function() { removeStatusIndicator(); }, statusTimeout);

clearTimeout(timer1)
Source

Also in JavaScript: