Skip to content

Instantly share code, notes, and snippets.

@aheckmann
Created June 14, 2012 18:10
Show Gist options
  • Save aheckmann/2931892 to your computer and use it in GitHub Desktop.
Save aheckmann/2931892 to your computer and use it in GitHub Desktop.
trampoline
var times = 0;
function loop () {
++times;
if (times >= 30000) return;
return loop;
}
function start () {
var fn;
while (fn = loop()) fn();
console.log('looped %d times', times);
}
start();
// looped 30000 times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment