Check if an object has a property question

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) {
  console.log("obj:", obj);
  // change code below this line
  if (obj.hasOwnProperty('Jeff', 'Alan', 'Sarah', 'Ryan')) {
    return true;

  } else {
    return false;
  }

  // change code above this line
}

console.log(isEveryoneHere(users));Preformatted text

Test is passing but I feel like my code is not correct. Could you one review it and let me know if it is correct. Thank you.

Hi,

Why do you think it’s incorrect?

I didn’t test it, but I think you could make it shorter:

function isEveryoneHere(obj) {
  return obj.hasOwnProperty('Jeff', 'Alan', 'Sarah', 'Ryan');
}