Created
October 13, 2015 16:30
-
-
Save rickbacci/369917bcfa3bc618abb5 to your computer and use it in GitHub Desktop.
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, callback){ | |
var interval = setInterval(function () { | |
if (seconds) { | |
callback(seconds--); | |
} else { | |
clearInterval(interval); | |
} | |
}, 1000); | |
} | |
countdown(5, function (s) { | |
console.log('wowowowowow', s); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment