floatleft
floatleft

Reputation: 6541

Push a multidimensional array in Jquery

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'}

Upvotes: 4

Views: 11875

Answers (1)

Krule
Krule

Reputation: 6476

Something like:

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

should work :)

Upvotes: 5

Related Questions