I am looping through an array of selected index comparing each value to a database of machine pricing, and returning the price of each selected index. the problem is, the result repData1 return individual results, I want those resuls to displayed in an array for I can manipulate the array. I have tried push, concat.... string results is displayed for each item rather than a whole.
for (let a = 0; a < selectedindex.length; a++) {
wixData
.query('MachinePricing')
.contains('title', selectedindex[a])
.find()
.then(async (results) => {
if (results.items.length > 0) {
let repData = results.items;
let repData1 = repData.map(({ prices }) => prices);
console.log(repData1);
}
});
}