Skip to content

Instantly share code, notes, and snippets.

@lacymorrow
Last active November 17, 2017 09:19
Show Gist options
  • Save lacymorrow/1edfa0c3b18061b7ec079f2be212eed1 to your computer and use it in GitHub Desktop.
Save lacymorrow/1edfa0c3b18061b7ec079f2be212eed1 to your computer and use it in GitHub Desktop.
JS - Loop a function call using setTimeout()
function doStuff() { return false; }
(function loopFunc() {
doStuff();
//setTimeout(arguments.callee, 100); // callee is deprecated
setTimeout(loopFunc, 100);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment