The Promise.all()
method accepts an array (or any other iterable) of promises as a parameter. It returns a Promise
object that is fulfilled if all of the input promises are fulfilled or rejected if any of the input promises is rejected:
Promise
object is fulfilled with an array of fulfillment values of all promises (in the same order as the promises passed to Promise.all()
).Promise
object is rejected with that reason.Please correct the word - length.
queryAPI("films").then(films => { output.innerText = '${films.legnth} films' ; });