Skip to content

Instantly share code, notes, and snippets.

@dsimard
Created May 19, 2010 14:38
Show Gist options
  • Select an option

  • Save dsimard/406362 to your computer and use it in GitHub Desktop.

Select an option

Save dsimard/406362 to your computer and use it in GitHub Desktop.
recursive count to 10 with named functions
var count = function countToTen(i) {
if (i <= 10) {
console.log(i);
countToTen(i+1); // You can cleanly call the named function
}
}
count(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment