Skip to content

Instantly share code, notes, and snippets.

@jjcall
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save jjcall/6b0ebf99eece0a8f3ebd to your computer and use it in GitHub Desktop.

Select an option

Save jjcall/6b0ebf99eece0a8f3ebd to your computer and use it in GitHub Desktop.
function blastOff(n) {
// Check if is not 0.
if( n !== 0) {
// assign n to i.
// subtract 1 from i while its greather than or equal to 0
for(i=n;i>=0;i--) {
// log i to the console
console.log(i);
}
// blast off after 0 is logged to the console
console.log("Blast Off");
}
}
blastOff(4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment