I have an array of objects that I initialize like so:
const balances = Array(5).fill({})
Later, I modify the balance for the first object using:
balances[0]['USD'] = 1000
I expect this to change only the balance for the first index. Instead, the 'USD' key is set for all of the elements:
balances // [{USD: 1000}, {USD: 1000}, {USD: 1000}, {USD: 1000}, {USD: 1000}]
// when I expected this:
balances // [{USD: 1000}, {}, {}, {}, {}]