Why does this not work while using usersObj.x.online
or even usersObj[x][online]
instead of usersObj[x].online
in the given below function ?
function countOnline(usersObj) {
let num=0;
for(let x in usersObj){
if(usersObj[x].online===true){
num++;
}
}
return num;
}