Basic Data Structure: Iterate Through the Keys of an Object with a for...in Statement

Please help me fix this code it is not working

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

“ffunction” is not going to work.

thanks let me fix it

not working again

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

I think it has something to do with the console.log at the bottom. If you remove it then the test pass.

Excellent thank you very much