resumable.js
function processCallbacks(items, cb){
      if(!items || items.length === 0){
        // empty or no list, invoke callback
        return cb();
      }
      // invoke current function, pass the next part as continuation
      items[0](function(){
        processCallbacks(items.slice(1), cb);
      });
    }
function processCallbacks(items, cb){
      if(!items || items.length === 0){
        // empty or no list, invoke callback
        return cb();
      }
      // invoke current function, pass the next part as continuation
      items[0](function(){
        processCallbacks(items.slice(1), cb);
      });
    }
function processCallbacks ( items , cb ) { if ( ! items || items . length === 0 ) { // empty or no list, invoke callback return cb ( ) ; } // invoke current function, pass the next part as continuation items [ 0 ] ( function ( ) { processCallbacks ( items . slice ( 1 ) , cb ) ; } ) ; }
cps-style list iteration.
invokes all functions in list and waits for their callback to be
triggered.
@param  {Function[]}   items list of functions expecting callback parameter
@param  {Function} cb    callback to trigger after the last callback has been invoked
cps - style list iteration . invokes all functions in list and waits for their callback to be triggered .