Solution is not provided

Solution is not provided


Tell us what’s happening:
I don’t know what to do to past the test. Anyone can 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 count = 0;
    for(let items in obj){
  return count;
  // change code above this line


Link to the challenge:


What do the failing tests say?


Hi siuhangw,

In your for loop console.log what “items” is and then that should help you continue with what you need to change.


the in operator is handing you over the keys of the object (the names of the users in this case), but what you want is the actual user, so you need to look the user up in the users object like so:



Thanks a-hariti. You saved my life


Thanks JohnAyling. Problem solved.