foreach loop does not work for async and always returns undefined. for of loop must be used. //PROPER ASYNC AWAIT FOREACH LOOP const arr = [1,2,3,4,5,6,7,8,9,10] for (const [index, value] of arr.entries()) { await /* YOUR FUNCTION HERE */ }