I am trying to modify the property at a specific index in my Array of Objects, Somehow when I try to modify one value it modifies all the values occurring in the array of objects.
Can anyone know what I did wrong here? I don't want to return a new array and want to update the same array.
let options = [];
let va = {
stat: {
cde: null,
abc: null,
},
};
options.push(va);
options.push(va);
//accessing first element from index
options[0].stat['abc'] = 'test';
console.log(options);