Let us simplify my issue; I have this piece of code:
let arr = []
for (let i = 0; i < 2; i++) {
arr.push({
i: i + 1
})
}
console.log(arr)
This outputs: Array [Object { i: 1 }, Object { i: 2 }]
But I want : Array [Object { 0: 1 }, Object { 1: 2 }] // Values of 'i' as object keys
How to achieve this?