Can i
array.push(fetch(`something`))
For execution in Promise.all / for await, or
fetch(`something`)
execute itself before i push it in array and not further in code when i want it?
More info:
Let assume i need to do many queries with for await (if i want to execute them one after another) or Promise.all (if i want to execute them async together).
I make an queries array:
let queries = []
let allResults = []
Push there promises:
tiersQueries.push(fetch(`something`))
And them execute it like this:
for await (const oneResult of queries) {
allResults.push(oneResult)
}
Or this:
let results = await Promise.all(array)
allResults = results