Skip to content

Instantly share code, notes, and snippets.

@jimdel
Created February 28, 2018 02:25
Show Gist options
  • Save jimdel/3d8957bf2d3bb0467f3f3b8da88d9749 to your computer and use it in GitHub Desktop.
Save jimdel/3d8957bf2d3bb0467f3f3b8da88d9749 to your computer and use it in GitHub Desktop.
function countdownToOne(num) {
//Base Case
if (num === 1) {
console.log(num)
} else {
//Recursive Case
console.log(num)
return countdownToOne(num - 1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment