this is my code
var arr = [{
id: '1',
total: "Total:",
titlea: 'a',
titleb: 'b',
}];
let c= {titlec: 'c'}
arr.push(c);
console.log(arr)
So the console.log shows that
0: {id: "1", totalPdf: "Total:", titlea: "a", titleb: "b"}
1: {titlec: "c"}
But I want it as:
0: {id: "1", totalPdf: "Total:", titlea: "a", titleb: "b", titlec: "c"}
How can I do that? Thanks
arr[0].titlec="c"or its equalarr[0]["titlec"]="c"0: {id: "1", totalPdf: "Total:", titlea: "a", titleb: "b", titlec: "c"}or{id: "1", totalPdf: "Total:", titlea: "a", titleb: "b", titlec: "c"}?