Skip to content

Instantly share code, notes, and snippets.

@sp3c73r2038
Created July 3, 2012 15:07
Show Gist options
  • Save sp3c73r2038/3040320 to your computer and use it in GitHub Desktop.
Save sp3c73r2038/3040320 to your computer and use it in GitHub Desktop.
loop for calling a function
var a = function (i) {
console.log(i)
setTimeout(a(++i), 1000); // wrong, the 1st parameters should be a function but passed a function calling by mistaken.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment