Tell us what’s happening:
I have no idea what to do in this challenge.
Your code so far
function countOnline(usersObj) {
// Only change code below this line
for (let user in usersObj) {
if (usersObj[user] === true) {
console.log(usersObj++);
return usersObj += 1;
} else {
console.log(usersObj += 0);
return usersObj += 0;
}
}
// Only change code above this line
}
console.log(countOnline({ Alan: { online: false }, Jeff: { online: true }, Sarah: { online: false } }));
Your browser information:
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0
.
Challenge: Iterate Through the Keys of an Object with a for…in Statement
Link to the challenge: