function countOnline(usersObj) {
// Only change code below this line
let count=0;
for (let usersObj in users) {
if(users[usersObj][‘online’]) {
count++;
}
}
return count;
// Only change code above this line
}
console.log(countOnline(users));
let object = {1: "a", 2: "b"};
for (let key in object) {
console.log(object[key]);
}
output:
a
b
You also try to declare usersObj as the variable in your loop, but it’s already the object you pass into the function. Instead you use the global object users…