Is it right that I am using variable as

Tell us what’s happening:

Is it right that I am using variable as Why I can`t sove this task?

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 result = 0;
      for(let x in obj){
        if( == true){
  return result;
  // change code above this line


Your browser information:

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

Link to the challenge:

Check out this fiddle and see what the problem in your code is (It isn’t what you titled this post. is the correct way to access the data.

Also, check this out:

Updated fiddle, if you aren’t comfortable with the console yet (you should get really comfortable with it, but hey, I am a completionist):

Do you mean that I can use like this if(

Inside your for loop, x will be a string (i.e. “Alan”, “Jeff”, “Sarah”, or ‘Ryan’. These are property names of obj. Think about how you can leverage x and access a specific object inside obj with x to get the value of the inner object’s online property.

Sorry, @RandellDawson is correct. I noticed a different error and focused on that instead of addressing your object of objects. You should take his hint about how to access the relevant member.