await all pronmises
Promise.all([promise1, promise2, promise3]).then(function(values) {
console.log(values);
});
await all pronmises
Promise.all([promise1, promise2, promise3]).then(function(values) {
console.log(values);
});
promise.all async await
async function fetchABC() {
const [a, b, c] = await Promise.all([a(), b(), c()]);
}
async await promise all javascript
let characterResponse = await fetch('http://swapi.co/api/people/2/')
let characterResponseJson = await characterResponse.json()
let films = await Promise.all(
characterResponseJson.films.map(async filmUrl => {
let filmResponse = await fetch(filmUrl)
return filmResponse.json()
})
)
console.log(films)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us