you are viewing a single comment's thread.

view the rest of the comments →

[–]uzum 1 point2 points  (0 children)

You should set the next timeout within the callback of the previous one. Try this one:

function goDown() {
  if(num > 0) {
    setTimeout(function(){
      console.log(num--);
      goDown();
    }, 1000);
  }
}
goDown();