TLDR: Use for...of
instead of forEach()
in asynchronous code.
For legacy browsers, use for...i
or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
This is a snippet that uses firebase's firebase-admin
to initialize multiple firebase projects in one admin application.
import 'firebase';