const price = [
{ad: 10},
{ad: 23},
{ad: 5},
{ad: 2},
{ad: 17}
]
const price = {
ad0: 10,
ad1: 23,
ad2: 5,
ad3: 2,
ad4: 17
}
const priceObj = Object.fromEntries(price.map((n, i) => [ `ad${i}`, n.ad ]));
const priceObj = price
.map(Object.entries)
.reduce((acc, [[ k, v ]], i) => (acc[k + i] = v, acc), {});
const priceObj = {};
for (const [ i, n ] of price.entries()) {
for (const k in n) {
priceObj[k.concat(i)] = n[k];
break;
}
}