I have two objects
var data = {property: [
{id: "1", name: "Snatch", type: "crime"},
{id: "2", name: "Witches of Eastwick", type: "comedy"},
{id: "3", name: "X-Men", type: "action"},
{id: "4", name: "Ordinary People", type: "drama"},
{id: "5", name: "Billy Elliot", type: "drama"},
{id: "6", name: "Toy Story", type: "children"}
]};
and
var data = {property: [
{id: "7", name: "Snatch", type: "crime"},
{id: "8", name: "Witches of Eastwick", type: "comedy"}
]};
Can I use jquery or javascript to combine the two as follows
var data = {property: [
{id: "1", name: "Snatch", type: "crime"},
{id: "2", name: "Witches of Eastwick", type: "comedy"},
{id: "3", name: "X-Men", type: "action"},
{id: "4", name: "Ordinary People", type: "drama"},
{id: "5", name: "Billy Elliot", type: "drama"},
{id: "6", name: "Toy Story", type: "children"},
{id: "7", name: "Snatch", type: "crime"},
{id: "8", name: "Witches of Eastwick", type: "comedy"}
]};
I've tried to use the push function but with no luck