I was thinking that i know much about javascript but i must have to admit i know nothing.
i have been trying to create a custom object but still seems no where.
var currentline=[
{"NAME":"Battery For Alarm Panel","CODE":"POWER MAX","OWN":"ONM"},
{"NAME":"Fire Alarm Panel","CODE":"SANA SERVICES","OWN":"ONM"}...
]
Through help of following question i'm able to create following object
// skipping main loop code for brevity
detailObj=[];
loop{
singleObj = {};
singleObj[currentline['NAME']] = {};
singleObj[currentline['NAME']][currentline['CODE']] = {};
singleObj[currentline['NAME']][currentline['CODE']][currentline['OWN']] = value;
detailObj.push(singleObj);
}
AND get the following detailObj
[
{"Battery For Alarm Panel":{"POWER MAX":{"ONM":7}}},
{"Fire Alarm Panel":{"SANA SERVICES":{"ONM":8}}}
]
how i can push an object into object despite into array and could get following object?
{
"Battery For Alarm Panel":{"POWER MAX":{"ONM":7}},
"Fire Alarm Panel":{"SANA SERVICES":{"ONM":8}}
}
is there any function to add object in the object?