I have a ton of functions that need to run in succession, but not before the other has completed. What I need is a way to queue these functions to run only after the previou
You don't need all that machinery, just put your functions in an array. Then you can loop over them.
var runThese = [
Function1,
Function2,
Function3,
Function4,
Function5
];
JavaScript is single-threaded so you're guaranteed one finishes before the next starts.
for (var i = 0; i < runThese.length; i++) {
runThese[i]();
}
Or since your functions have deterministic names, you could avoid the array altogether:
for (var i = 1; i <= 5; i++) {
window["Function" + String(i)]();
}