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;
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c252cd-3baf6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c252cd-3baf6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?