Skip to content

Instantly share code, notes, and snippets.

@x1a0
Created April 14, 2016 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x1a0/d95ea5f13d287bc853b012d5516e7933 to your computer and use it in GitHub Desktop.
Save x1a0/d95ea5f13d287bc853b012d5516e7933 to your computer and use it in GitHub Desktop.
var runFrom = function(step, lastStep, callback) {
var cb = step >= lastStep ? callback : function() {
runFrom(step + 1, lastStep, callback);
};
this['step' + step].call(this, cb);
};
runFrom(1, 17, function() {
console.log('finally done...');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment