Created
April 14, 2016 14:11
-
-
Save x1a0/d95ea5f13d287bc853b012d5516e7933 to your computer and use it in GitHub Desktop.
This file contains 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 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