0

So, I have the following js object structure:

enter image description here

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?

1 Answer 1

5

make it

obj["d7vi"].push(newValue);

you need to add to the array rather than replace its existing values.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.