Tell us what’s happening:
Describe your issue in detail here.
So basically I was asked to make a function so when Alan, Jeff, Sarah, or Ryan is passed through isEveryoneHere() it should return true. I just wanted an explanation on why this didnt count as a pass. the question is from javascript algorithms and data structures basic data structures check if an object has a property
**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(userObj) {
if (users.hasOwnProperty(userObj)) {
return true
}
return false
}
console.log(isEveryoneHere('Ryan'));
let users = {
Alan: {
age: 27,
online: true
},
Jeff: {
age: 32,
online: true
},
Sarah: {
age: 48,
online: true
},
Ryan: {
age: 19,
online: true
}
};
function isEveryoneHere(userObj) {
if (users.hasOwnProperty(userObj)) {
return true
}
return false
}
console.log(isEveryoneHere('Ryan'));
**Your browser information:**
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14150.87.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.124 Safari/537.36
Challenge: Check if an Object has a Property
Link to the challenge: