title: switch case js two parameters
body: <p>Please tell me how I can do with two parameters and simplify this code to a normal state. Thank you! This logic is very necessary for me, I hope for your indulgence.</p>
  
  <pre><code>var treshhold_two = 0;
  
  function Test(attack, ratio) {
    switch (attack) {
      case 0,01:
        switch (ratio) {
          case 2:
            treshhold = 2798,6;
            break;
          case 4:
            treshhold = 3678,16;
            break;
          case 6:
            treshhold = 5757,12;
            break;
        }
        break;
      case &gt;0,01:
        switch (attack, ratio) {
          case 0,03,2:
            treshhold = -5,75712;
            break;
          case 0,03,4:
            treshhold = -5,75712 * 1,1;
            break; // -45%
          case 0,03,6:
            treshhold = -5,75712 * 0,96;
            break; // -52%, and etc.
          ...
        }
        break;
    }
  }
  </code></pre>