Stuck on an exercise... Help!

Hi fellas.
The follow is the requirement of the exercise-
We’ve defined a function, countOnline ; use a for…in statement within this function to loop through the users in the users object and return the number of users whose online property is set to true .
I’ve tried everything but the value of the variable ‘i’ remains 0;
Please help.

Your code so far

let users = {
  Alan: {
    age: 27,
    online: false
  Jeff: {
    age: 32,
    online: true
  Sarah: {
    age: 48,
    online: false
  Ryan: {
    age: 19,
    online: true
function countOnline(obj) {
  // change code below this line
 let i=0;
for(let user in obj){
return i;
  // change code above this line


Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0.

Link to the challenge:

Look at how works carefully, and mayble play with it a little bit. What is “user” in each iteration of the loop?

Oooh! Thank you @ArielLeslie. :smiley: