Created
November 28, 2019 05:57
-
-
Save jjgonecrypto/ff1a432025133f4c9cd62a0ddd48e61b to your computer and use it in GitHub Desktop.
async forEach
This file contains hidden or 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
| // Useful if you want to run a bunch of promises in serial (which admittedly isn't very often frankly) | |
| exports.asyncForEach = async (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