Sorry I'm a new student, sorry this is so simple yet I still do not understand the object even after some research.
var obj = [
{day:"monday", status:"present" , reason:""},
{day:"tuesday", status:"present" , reason:""},
{day:"wednesday", status:"absence" , reason:"sick"},
]
to be like this :
Total days: 3
Total present: 2
Total absence: 1
do i have to use iteration ?
for (var key in obj) {
var currentObj = obj[key];
}
var totaldays = obj.length ;
console.log(totaldays);
and why var totaldays = obj.length ;
didnt work without iteration ?
also #2 question
{day:"monday", status:"present" , reason:""},
and
{"day":"monday", "status":"present" , "reason":""},
are those same or not ? sorry i feel like more understand with questioning in person/community rather than read in w3school or another cause I've tried over and over again and still get confused. but I always read first, asking is my last option