Iterate Through the Keys of an Object with a for...in Statmnt

Tell us what’s happening:

Your code so far


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

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 9; SM-N950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Mobile Safari/537.36.

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

Link to the challenge:

Hi, you forgot to Tell us what’s happening!

  • Check your caPitaLIsaTIon of the passed object in your for…in loop.