I'm trying to make a function that makes an iterable of promises programmatically to call them by using promise.all
like this:
const fetchRandomItems = async (numberOfItems) =>
const myPromises = [fetchRandomItem, fetchRandomItem, fetchRandomItem] // The length of this array should be equal to numberOfItems
promise.all(myPromises)
}
I dont know how to make myPromises's length equal to numberOfItems
Please and Thanks!