Reputation: 602
I have an array that contains 1 item. It looks like this ...
[ { one: "one", two: "two" } ]
I want to add to the object so it how looks like this ...
[ { one: "one", two: "two", three: "three" } ]
how do I do that?
Upvotes: 0
Views: 92
Reputation: 20189
Basic Javascrpt.
var array = [ { one: "one", two: "two" } ];
array[0].three = 'three';
means, array
at index 0
set three
to equal"three"
PS: this, nor are you using JSON
Upvotes: 2