Skip to content

Instantly share code, notes, and snippets.

@mde mde/iterative_cps.js
Created Sep 22, 2015

Embed
What would you like to do?
Iterative, but CPS
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
You can’t perform that action at this time.