Tell us what’s happening:
I don’t know what to do to past the test. Anyone can help?
Your code so far
let users = {
Alan: {
age: 27,
online: false
},
Jeff: {
age: 32,
online: true
},
Sarah: {
age: 48,
online: false
},
Ryan: {
age: 19,
online: true
}
};
function countOnline(obj) {
// change code below this line
let count = 0;
for(let items in obj){
if(items.online){
count++;
}else{
console.log("wowo");
}
}
return count;
// change code above this line
}
console.log(countOnline(users));
Link to the challenge:
javascript-algorithms-and-data-structures/basic-data-structures/-iterate-through-the-keys-of-an-object-with-a-for—in-statement