Help with Iterate with a For/In Statement

hey, i can’t figure it out, in theory what I thought I was typing would work but it’s not working like I want it to. It wont properly return the count of online users. it only iterates to the first user who is online then returns the count as “1” instead of “2”.

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 count = '';
  for (let user in obj) {
    if (obj[user].online === true) {
      count++;
      return count;
    }
  }
  // change code above this line
}

console.log(countOnline(users));

once the return statement is executed the function returns a number and stop. looking at where it is it can become at most 1

thank you. I moved the location of my return and it worked.