I have a object and I am trying to get the those value have false value but not able to get the value of those property who have array or objects.
Below is my code
var obj = [{
"class": true,
"room": false,
"students": [
true,
false
],
"result": {
"first": "pass",
"second": "fail",
"third":false
}
}];
for(var i = 0; i<obj.length; i++){
for(name in obj[i]){
//console.log(obj[i].hasOwnProperty(name))
if(!obj[i][name]){
console.log(name)
}
}
}
currently result coming only "room"
/ required result is "room",1, "third"