Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save dsimard/406360 to your computer and use it in GitHub Desktop.
recursive count to 10 anonymous
var count = function(i) {
if (i <= 10) {
console.log(i);
arguments.callee(i+1); // this will throw an error on ECMAScript 5 strict
}
}
count(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment