Last active
December 17, 2020 16:33
-
-
Save stctheproducer/670a424e6b23a540c5a3f246bba61bb7 to your computer and use it in GitHub Desktop.
A JavaScript asyncronous forEach function to use when working with asynchronous functions and arrays
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const async function asyncForEach(array, callback) { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment