Does switch have two conditions at the same time?

var url = "x.php";
var get = "add_x";
switch(url) {
  case "/x.php":
    $("-sharpmenu").show();
  break;
}

above is only to judge what url is and what to do
but can I add get judgment? Do the same thing!
is the same as $("- sharpmenu"). Show ();
, but switch has been determined by the url event
how to add get
is like I want to add another switch

switch(get) {
  case "add_x":
    $("-sharpmenu").show();
  break;
}

can you agree


in switch (expression), expression can only be an integer expression or enumeration constant, and integer expressions can be of type int or Integer wrapper. Because byte,short,char can be implicitly converted to int types, these types can also be used as expressions.
you can put two values in a new array, that is, enumerate constants, and determine that the break, program will continue to execute after the case of the first constant. If both values are satisfied by case, both case can be executed. I don't know if it meets your requirements ~


define a method

function foo(key){
  switch(key) {
    case 'x.php':
    case 'add_x':
      $("-sharpmenu").show();
    break;
  }
}
foo(url);
foo(get);

var url = 'x.php';
var get = 'add_x';
switch(true) {
  case url  == '/x.php' && get == 'add_x':
    $("-sharpmenu").show();
  break;
}
Menu