Tell us what’s happening:
I tried to copy the example, but it was something else I had to do.
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 (obj in users | users.hasOwnProperty(obj)) {
return true;
}
return false;
// Only change code above this line
}
console.log(isEveryoneHere(users));
Your browser information:
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0
.
Challenge: Check if an Object has a Property
Link to the challenge: