Basic Data Structures - Check if an Object has a Property

let users = {
  Alan: {
    age: 27,
    online: true
  },
  Jeff: {
    age: 32,
    online: true
  },
  Sarah: {
    age: 48,
    online: true
  },
  Ryan: {
    age: 19,
    online: true
  }
};

function is EveryoneHere(userObj) {
  // Only change code below this line
  return ["Alan" , "Jeff" , "Sarah" , "Ryan"].every(name => name in users)
  // Only change code above this line
}

console.log(isEveryoneHere( ));

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

Yeah, I just started coding and not too familiar with commenting and breaking down problems. Thanks for letting me know about how important breaking down a problem is. Most times, if the problem gets too critical, I just find answers instead of trying some wits lol.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.