async function asyncForEach(array, callback) { for (let index = 0; index < array.length; index += 1) { // eslint-disable-next-line no-await-in-loop await callback(array[index], index, array); } } // credit to https://codeburst.io/javascript-async-await-with-foreach-b6ba62bbf404