Is it possible to use switch case for more than one array.indexOf
You could for example put all actions in an object

var actions = {
  "session": function() { console.log("session"); },
  "virtual": function() { console.log("virtual"); },
};


and loop over its keys:

var activities = [
    "session",
    "virtual",
    "other"
];

for(let i = 0; i &lt; activities.length; i++) {
  let action = actions[activities[i]];
  if (action) action();
}