4

I have an array set to "values", and within the array is an multidimensional array called items.

values = {
 full_name: fullname,
 items: [{'item-id': '001', 'item-special': 'nothing'}, {'item-id': '031', 'item-special': 'Make it blue'}],
 address_full: address
 };

How would I push more items into the array?

{'item-id': '055', 'item-special': 'Extra large'}
kqlambert
2,7116 gold badges34 silver badges52 bronze badges
asked Dec 3, 2011 at 2:50

1 Answer 1

5

Something like:

values.items.push({'item-id': '055', 'item-special': 'Extra large'});

should work :)

answered Dec 3, 2011 at 2:54
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.