
Promise.all() – Waits for all promises to fulfill. Rejects immediately if any promise rejects.
๐ Syntax
Promise.all([p1, p2, p3]).then(results => {
// all results here
});
๐งช Example
Promise.all([
fetch('/a'), fetch('/b')
]).then(([a, b]) => console.log('Done'))
Comments
Post a Comment