title: Run functions that return promises in series after promise is done
body: <p>I have an array of functions that I need to execute.
  Those functions all return a promise.</p>
  
  <p>I want to run all the functions in series, but the next function can only be started if the promise of the previous function is done.</p>
  
  <p>I thought this would be easy with the async or bluebird library, but I can't find a simple solution to this.</p>
  
  <p>Here is something I made (untested), but I was looking for a standard library solution because this probably already exists?</p>
  
  <pre><code>function runFuncs(funcs) {
  
      function funcRunner(funcs, resolve, reject, pos=0) {
          funcs[pos]().then(function() {
              pos++;
              if (pos &lt; length(funcs)) {
                  funcRunner(funcs, pos);
              } else {
                  resolve();
              }
          }).catch(function(err) {
              reject(err);
          });
      }
  
      return new Promise(function(resolve, reject) {
          funcRunner(funcs, resolve, reject);
      });
  }
  </code></pre>