asyncForEach function with promise support
npm install asyncforeach-promisenpm install command:
bash
$ npm install --save asyncforeach-promise
`
Usage
forEach(arrayOrIterableElement, callbackFunction)
Example:
`js
const forEach = require("asyncforeach-promise");
const array = [34, 24, 54];
forEach(array, (element, index, next) => {
console.log(element);
next()
})
.then(() => {
console.log("finished");
})
.catch(console.error);
`
$3
`bash
34
24
54
finished
``