Created
February 6, 2018 09:23
-
-
Save jsmayo/1e764b4557fa4725b4f45c72f32f5229 to your computer and use it in GitHub Desktop.
countDown(seconds) Definition created by jsmayo - https://repl.it/@jsmayo/countDownseconds-Definition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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