test = [{
property1: "value 1",
property2: "value 2"
}];
if I do this
test.push[{property3: "value 3"}];
I get a new object. I want to add it to existing object.
How can I do this?
asked Jan 10, 2013 at 2:08
jamjam
3,2897 gold badges36 silver badges39 bronze badges
1 Answer 1
test[0].property3 = "value 3";
or
test[0]['property3'] = "value 3";
answered Jan 10, 2013 at 2:11
Musa
97.9k17 gold badges123 silver badges144 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js