• <bdo id='WKSHL'></bdo><ul id='WKSHL'></ul>
    <legend id='WKSHL'><style id='WKSHL'><dir id='WKSHL'><q id='WKSHL'></q></dir></style></legend>
    1. <i id='WKSHL'><tr id='WKSHL'><dt id='WKSHL'><q id='WKSHL'><span id='WKSHL'><b id='WKSHL'><form id='WKSHL'><ins id='WKSHL'></ins><ul id='WKSHL'></ul><sub id='WKSHL'></sub></form><legend id='WKSHL'></legend><bdo id='WKSHL'><pre id='WKSHL'><center id='WKSHL'></center></pre></bdo></b><th id='WKSHL'></th></span></q></dt></tr></i><div id='WKSHL'><tfoot id='WKSHL'></tfoot><dl id='WKSHL'><fieldset id='WKSHL'></fieldset></dl></div>
    2. <tfoot id='WKSHL'></tfoot>

        <small id='WKSHL'></small><noframes id='WKSHL'>

      1. 切换案例到/之间

        时间:2023-09-07
      2. <small id='mMViK'></small><noframes id='mMViK'>

          <bdo id='mMViK'></bdo><ul id='mMViK'></ul>

                <tbody id='mMViK'></tbody>

                <legend id='mMViK'><style id='mMViK'><dir id='mMViK'><q id='mMViK'></q></dir></style></legend>
                <tfoot id='mMViK'></tfoot>
                <i id='mMViK'><tr id='mMViK'><dt id='mMViK'><q id='mMViK'><span id='mMViK'><b id='mMViK'><form id='mMViK'><ins id='mMViK'></ins><ul id='mMViK'></ul><sub id='mMViK'></sub></form><legend id='mMViK'></legend><bdo id='mMViK'><pre id='mMViK'><center id='mMViK'></center></pre></bdo></b><th id='mMViK'></th></span></q></dt></tr></i><div id='mMViK'><tfoot id='mMViK'></tfoot><dl id='mMViK'><fieldset id='mMViK'></fieldset></dl></div>
                1. 本文介绍了切换案例到/之间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 Javascript 中有没有一种方法可以在不使用 if 语句的情况下通过 switch case 结构将一个整数与另一个整数进行比较?

                  Is there a way in Javascript to compare one integer with another through switch case structures without using if statements?

                  例如

                  switch(integer) {
                      case 1 to 10:
                          break;
                      case 11 to 20:
                          break;
                      case 21 to 30:
                          break;
                  }
                  

                  推荐答案

                  你可以做一些数学运算.

                  You can do some math manipulations.

                  switch(Math.ceil(integer/10)) {
                      case 1: // Integer is between 1-10
                          break;
                      case 2: // Integer is between 11-20
                          break;
                      case 3: // Integer is between 21-30
                          break;
                  }
                  

                  这篇关于切换案例到/之间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用字符串“includes()";在切换 Javascript 的情况下 下一篇:jquery 在切换案例中使用范围?

                  相关文章

                    <i id='X1yrZ'><tr id='X1yrZ'><dt id='X1yrZ'><q id='X1yrZ'><span id='X1yrZ'><b id='X1yrZ'><form id='X1yrZ'><ins id='X1yrZ'></ins><ul id='X1yrZ'></ul><sub id='X1yrZ'></sub></form><legend id='X1yrZ'></legend><bdo id='X1yrZ'><pre id='X1yrZ'><center id='X1yrZ'></center></pre></bdo></b><th id='X1yrZ'></th></span></q></dt></tr></i><div id='X1yrZ'><tfoot id='X1yrZ'></tfoot><dl id='X1yrZ'><fieldset id='X1yrZ'></fieldset></dl></div>
                    <legend id='X1yrZ'><style id='X1yrZ'><dir id='X1yrZ'><q id='X1yrZ'></q></dir></style></legend>

                    • <bdo id='X1yrZ'></bdo><ul id='X1yrZ'></ul>

                    1. <small id='X1yrZ'></small><noframes id='X1yrZ'>

                      <tfoot id='X1yrZ'></tfoot>