This question is asked in many JavaScript, Node, Angular, React.. interviews
Why use Promise.all ?
Promise.all is actually a promise that takes an array of promises as an input (an iterable). Then it gets resolved when all the promises get resolved or any one of them gets rejected.
Promise.all([Promise1, Promise2…