add 3d argument to asyncIterator callback

This commit is contained in:
casperlamboo 2017-11-06 10:22:15 +01:00
parent 0ed0a98efa
commit 22bd0b6953

View File

@ -18,7 +18,7 @@ export async function asyncIterator(array, callback) {
const result = [];
for (let i = 0; i < array.length; i ++) {
const item = array[i];
const itemResult = await callback(item, i);
const itemResult = await callback(item, i, array);
result.push(itemResult);
}
return result;