📜  js 将 if else 语句转换为 switch case - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:08.404000             🧑  作者: Mango

代码示例4
switch (true) {
          case bid < 100000:
            currentIncrease = 1000;
            break;
          case type != 1 && bid - 1000 < 100000:
            currentIncrease = 1000;
            break;
          case type != 1 && bid - 2000 < 1000000:
            currentIncrease = 2000;
            break;
          case bid < 1000000:
            currentIncrease = 2000;
            break;
          default:
            currentIncrease = 10000;
        }