• <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. 切换案例到/之间

        Switch Case To/Between(切换案例到/之间)
      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;
                  }
                  

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

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Pause youtube video, youtube api(暂停 youtube 视频,youtube api)
                  Youtube iframe api not triggering onYouTubeIframeAPIReady(Youtube iframe api 未触发 onYouTubeIframeAPIReady)
                  How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                  How to call Greasemonkey#39;s GM_ functions from code that must run in the target page scope?(如何从必须在目标页面范围内运行的代码中调用 Greasemonkey 的 GM_ 函数?)
                  How do you mute an embedded Youtube player?(如何使嵌入式 Youtube 播放器静音?)
                  How to get number of video views with YouTube API?(如何使用 YouTube API 获取视频观看次数?)

                      <tbody id='X1yrZ'></tbody>

                    <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>