[dot-notation causes errors in this challenge.] Iterate Through the Keys of an Object with a for...in Statement

Tell us what’s happening:
why dot-notation causes errors in this challenge.

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

  // change code above this line
}

console.log(countOnline(users));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/-iterate-through-the-keys-of-an-object-with-a-for---in-statement

What error are you getting? What is your code?

I will guess, and suggest this reading

Bracket notation can use variables, so it is useful in two instances where dot notation will not work:

  1. When the property names are dynamically determined (when the exact names are not known until runtime).

  2. When using a for…in loop to go through all the properties of an object.

this thread is over a year old, maybe try helping people that have asked for help in the last week or so?
probably after a year they do not need help anymore