Serially Iterating An Array, Asynchronously

added by JavaScript Kicks
3/16/2015 2:04:07 PM


I recently found myself looking at an array of functions in JavaScript. I needed to iterate through this list, process each function in an asynchronous manner (providing a “done” callback method), and ensure that I did not move on to the next item in the list until the current one was completed. The answer I found was in recursion and shifting through the array (grabbing the first item out of the array on each pass).