Help! Iterate Through the Keys of an Object with a for...in Statement Help!

Tell us what’s happening:

grrr…I am not getting this one at all! Have read through so many of the posts on here already and tried various ways. Have read the hint as well and even copied the solution from the hint as well! Still not getting it? Why can’t the example they show match what they want us to do? Any advice.
Thans

Your code so far


function countOnline(usersObj) {
 // Only change code below this line
let result = 0;
for (let user in obj){
  if(obj[user].online===true){
    result++
  }
}
return result;
 // Only change code above this line
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36.

Challenge: Iterate Through the Keys of an Object with a for…in Statement

Link to the challenge:

the example shows what they want you to do
the issue is an other

what’s obj? where is it defined?

the problem is that you use obj inside the function but your parameter is usersObj

haha…took me long enough but I got it in the end. Keep staring at the problem until you can’ t see it!