There is a question about for await ... of loop.
I have the following code:
for await (let V of reagent_items.map(object_element => getPricing(object_element))) {
console.log(object_element) //I'd like to have access to current iteration.
//or
console.log(reagent_items[i]) //current fulfilled element from reagent.map
}
So the problem is that this array (from .map) of functions (V as a single response of getPricing) doesn't return the object_element itself but I need to have access to this object element inside for await ... of loop.
Does it possible somehow or not? And if it doesn't, using of
Promise.allhandles this problem somehow? Or I should modify the originalgetPricingandreturncurrentobject_elementwith other results?