I am dealing with a JavaScript object array like the one below.
var satelliteListByGroup = {
Default: {
AccessCX1141016091532: {
name: "IAD_ACS4",
iname: "IAD_ACS4_core0",
ra: "[Not assigned]",
ip: "1.1.1.1",
status: "Permitted, last connected Jan 14, 2019 10:19:12 AM",
col: "#ff5555",
fw: "5.0.0.31",
srv: "Enabled"
},
AccessCX1180424080022: {
name: "IAD_ACS4",
iname: "IAD_ACS4_core0",
ra: "[Not assigned]",
ip: "1.1.1.1",
status: "Permitted, last connected Jan 14, 2019 10:19:12 AM",
col: "#ff5555",
fw: "5.0.0.31",
srv: "Enabled"
}
}
};
I am attempting to add a new second-level entry but have been struggling to get it right. I've experimented with different approaches similar to this:
var arr1 = {
AccessCX11410160916546: {
name: "IAD_ACS4",
iname: "IAD_ACS4_core0",
ra: "[Not assigned]",
ip: "5.5.5.5",
status: "Permitted, last connected Jan 14, 2019 10:19:12 AM",
col: "#ff5555",
fw: "5.0.0.31",
srv: "Enabled"
}
};
satelliteListByGroup.Default.push(arr1);
In this case, using push is not working correctly. It seems to only function with the primary array name.