Why this code (my code) is incorrect?
Your code so far
let users = {
Alan: {
age: 27,
online: true
},
Jeff: {
age: 32,
online: true
},
Sarah: {
age: 48,
online: true
},
Ryan: {
age: 19,
online: true
}
};
function isEveryoneHere(obj) {
// Only change code below this line
if('Alan' in obj && 'Jeff' in obj && 'Sarah' in obj &&'Rayan' in obj)
{ return true;
}
else{ return false;}
// Only change code above this line
}
console.log(isEveryoneHere(users));
Your browser information:
Challenge: Check if an Object has a Property
Link to the challenge: