code: function (iter, fn) {
        return new Promise(function (resolve) {
          var i = 0;
          function next() {
            return iter.next().then(function (result) {
              if (result.done) {
                return result.value;
              }
              fn(result.value, i++);
              return next();
            });
          }
          resolve(next());
        });
      }
docs: Iterate over *AsyncIterator* and execute given function for each value.