I have an array that looks like this:
items = {
item1: 10,
item2: 5,
item3: 7,
item4: 3,
};
I am looking to include additional details in this array, for example:
items = {
item1: 10 {available: true},
item2: 5 {available: false},
item3: 7 {available: true},
item4: 3 {available: true},
};
I've attempted various methods such as:
items.item2.available = true;
However, I did not see any changes in the array.
Is there a proper way to achieve this? Or is there a more effective approach to solving this problem?