Skip to content

Instantly share code, notes, and snippets.

@jsmayo
Created February 6, 2018 09:23
Show Gist options
  • Select an option

  • Save jsmayo/1e764b4557fa4725b4f45c72f32f5229 to your computer and use it in GitHub Desktop.

Select an option

Save jsmayo/1e764b4557fa4725b4f45c72f32f5229 to your computer and use it in GitHub Desktop.
countDown(seconds) Definition created by jsmayo - https://repl.it/@jsmayo/countDownseconds-Definition
function countDown(seconds) {
var i = seconds;
var countDownTimer = setInterval(function() {
console.log("Timer: ", i);
i--;
if(i === 0) {
console.log("Ring Ring Ring!!!");
clearInterval(countDownTimer);
}
}, 1000);
}
countDown(3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment