Created
September 22, 2015 00:06
-
-
Save mde/3a92c18db6bef2703e9f to your computer and use it in GitHub Desktop.
Iterative, but CPS
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 iterativeRunner = function (arr) { | |
var funcs = arr.map(function (item, index) { | |
return function () { | |
item(function () { | |
if (funcs[index + 1]) { | |
funcs[index + 1](); | |
} | |
}); | |
}; | |
}); | |
funcs[0](); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment