function a (i) {
return fetch('google.com/'+i);
}
function b() { return 666 }
var e = [a,a,a,b,a,a];
var r = [];
var p = new Promise((res, rej) => {
function* main (arr) {
var i = 0;
var data = null;
while (i < arr.length) {
data = yield (async function f(pr, data) {
var r = await pr(i);
it.next(r)
})(arr[i], data);
r.push(data);
i += 1;
}
res(r);
}
var it = main(e);
it.next();
});
p.then(console.log)