Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function countdown(seconds, callback){
- var interval = setInterval(function () {
- if (seconds) {
- callback(seconds--);
- } else {
- clearInterval(interval);
- }
- }, 1000);
- }
- countdown(5, function (s) {
- console.log('wowowowowow', s);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement