I want to update the data which is array based on key present in another array and if key is not present output the data with value 0 along with corresponding key
let data = [{
ORIGEN: "WB716594",
"Gestor Ericsson OSS": 1
}, {
ORIGEN: "MM-LORC-AGUI-L3-11_760525",
"MM-LORC-AGUI-L3-11_760525": 1
}];
let keyValue = ["Gestor Ericsson OSS",
"MM-LORC-AGUI-L3-11_760525",
"Gestor HUA U2KVIA",
"5620SAM"
]
Here "Gestor HUA U2KVIA" and "5620SAM" is not present in the data and hence it should be append as below
Output = [{ORIGEN: "WB716594", Gestor Ericsson OSS: 1, "MM-LORC-AGUI-L3-11_760525":0,Gestor HUA U2KVIA:0,5620SAM:0},
{ORIGEN: "MM-LORC-AGUI-L3-11_760525", MM-LORC-AGUI-L3-11_760525: 1,Gestor Ericsson OSS: 0,Gestor HUA U2KVIA:0,5620SAM:0}
]