I have this json:
var json = {
"0":{
"check":true,
"OBJECT_ID":{
"check":false,
"name":"OBJECT_ID",
},
"nameTable":"TEST1",
"EVENT_NAME_MANAGE":{
"check":false,
"name":"EVENT_NAME_MANAGE",
}}
"1":{
"check":true,
"OBJECT_ID":{
"check":false,
"name":"OBJECT_ID",
},
"nameTable":"TEST1",
"EVENT_NAME_MANAGE":{
"check":false,
"name":"EVENT_NAME_MANAGE",
}
}
}
I would like if I get 0 or 1, change the value of ObJECT_ID
and EVENT_NAME
to true
I've tried doing this for:
for (var i in json) {
console.log(json[i].nameTable)
}
As I get 0 or 1, I have to go through what's inside them (in my example I only have 2 the ObJECT_ID and EVENT_NAME but I have many more) and change the check value inside them by true