Reputation: 533
So, I have the following js object structure:
I am trying to add a value to this, for example, "234324" after "ewerewr".
I tried obj["d7vi"] = new_value;
But it gets rid of all the previous values.
Any help?
Upvotes: 0
Views: 171
Reputation: 68393
make it
obj["d7vi"].push(newValue);
you need to add to the array rather than replace its existing values.
Upvotes: 5