code: function forEachPromise(items, fn) {
    return items.reduce(
      (promise, item) => promise
        .then(() => fn(item))
        .catch((error) => { throw error; }),
      Promise.resolve()
    );
  }
docs: From https://stackoverflow.com/a/41791149/1669674
  
  @param items An array of items.
  @param fn A function that accepts an item from the array and returns a promise.
  @returns {Promise}