1. <tfoot id='7DVik'></tfoot>

        <bdo id='7DVik'></bdo><ul id='7DVik'></ul>

      <small id='7DVik'></small><noframes id='7DVik'>

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

      2. 非法的继续声明?

        时间:2024-04-19
      3. <i id='LN7G9'><tr id='LN7G9'><dt id='LN7G9'><q id='LN7G9'><span id='LN7G9'><b id='LN7G9'><form id='LN7G9'><ins id='LN7G9'></ins><ul id='LN7G9'></ul><sub id='LN7G9'></sub></form><legend id='LN7G9'></legend><bdo id='LN7G9'><pre id='LN7G9'><center id='LN7G9'></center></pre></bdo></b><th id='LN7G9'></th></span></q></dt></tr></i><div id='LN7G9'><tfoot id='LN7G9'></tfoot><dl id='LN7G9'><fieldset id='LN7G9'></fieldset></dl></div>

            <tbody id='LN7G9'></tbody>
          <legend id='LN7G9'><style id='LN7G9'><dir id='LN7G9'><q id='LN7G9'></q></dir></style></legend>
          <tfoot id='LN7G9'></tfoot>
          • <bdo id='LN7G9'></bdo><ul id='LN7G9'></ul>

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

                  本文介绍了非法的继续声明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有类似下面的代码:

                  _.each data, (value, type) ->
                      switch type
                          when "answered"
                              icon = "results_answered"
                              label = definitions.results.metrics.ta
                          when "leftblank"
                              icon = "results_lb"
                              label = definitions.results.metrics.tlb
                          when "standing"
                              icon = "results_standing"
                              label = definitions.results.metrics.cs
                          when "minimum"
                              icon = "results_min"
                              label = definitions.results.metrics.lowest
                          else
                              continue
                  
                      metricLine = utilities.div("metricline")
                      metricLine.grab utilities.sprite(icon, "metric_icon")
                      metricLine.grab utilities.div("metriclabel", label + ":")
                      metricLine.grab utilities.div("metricvalue", value)
                      metricContainer.grab(metricLine)
                  
                  metricContainer
                  

                  但它会向我的浏览器抛出以下错误:

                  But it throws the following error to my browser:

                  Uncaught SyntaxError: Illegal continue statement

                  Uncaught SyntaxError: Illegal continue statement

                  是否可以像我尝试的那样包含 continue 而不会引发错误?

                  Is it possible to include a continue like I am trying without throwing the error?

                  推荐答案

                  如果你想继续下一个循环迭代,你想要return,而不是continue,如你传递给 each 的是一个函数.

                  If you want to continue with the next loop iteration, you want return, not continue, as what you're passing to each is a function.

                  在您提到熟悉 C# foreach 循环的评论中,因此想要使用 continue.不同之处在于,使用 C# 的 foreach,您处理的是一个实际的循环构造,而 each 实际上是为每个循环迭代调用一个函数,所以它不是(在语言级别)一个循环,所以你不能继续它.

                  In a comment you mentioned being familiar wih the C# foreach loop, hence wanting to use continue. The difference is that wih C#'s foreach, you're dealing with an actual loop construct, whereas each is actually calling a function for each loop iteration, so it's not (at a language level) a loop, so you can't continue it.

                  这篇关于非法的继续声明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Mongoose:Coffeescript 中的递归嵌入文档 下一篇:Jquery UI Draggable:将助手对齐到鼠标位置

                  相关文章

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

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

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