Switch case does not seem to be working when checking for properties in an object. Is if/else statement the only way to check?

TASK:
Finish writing the isEveryoneHere() function so that it returns true if the object passed to it contains all four names, Alan, Jeff, Sarah and Ryan and returns false otherwise.

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) {
  // Only change code below this line
  switch(userObj){
    case 'Alan'in userObj: 
      return true;
      break;
    case 'Jeff'in userObj:
      return true;
      break; 
    case 'Sarah'in userObj: 
      return true;
      break;
    case 'Ryan'in userObj: 
      return true;
      break;
    default:
      return false;
  }  
}

// Final Solution:
/*
function isEveryoneHere(userObj) {
  // Only change code below this line
  if('Alan' in userObj && 'Jeff' in userObj&&
    'Sarah' in userObj && 'Ryan' in userObj){
      return true;
    }  
    return false;
}*/
console.log(isEveryoneHere(users));

hi there, is this an fCC challenge? Can you post a link to the challenge if so?

your switch expression and case statements are not written correctly.
here’s an example of how to write them

Edit: note that the expression is only evaluated once. (that means whatever you decide to ‘switch’ on, is evaluated once, them compared to the case values till a match is found)