Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

await asyc foreach

Array.prototype.forEachAsync = async function (fn) {
    for (let t of this) { await fn(t) }
}

Array.prototype.forEachAsyncParallel = async function (fn) {
    await Promise.all(this.map(fn));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #await #asyc #foreach
ADD COMMENT
Topic
Name
8+7 =