Created
June 14, 2012 18:10
-
-
Save aheckmann/2931892 to your computer and use it in GitHub Desktop.
trampoline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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