• <bdo id='0sRhW'></bdo><ul id='0sRhW'></ul>
    1. <small id='0sRhW'></small><noframes id='0sRhW'>

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

        <tfoot id='0sRhW'></tfoot>
      1. 编写 CoffeeScript 时有没有办法捕捉错别字

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

          • <legend id='gW0jg'><style id='gW0jg'><dir id='gW0jg'><q id='gW0jg'></q></dir></style></legend>
          • <tfoot id='gW0jg'></tfoot>
              <tbody id='gW0jg'></tbody>

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

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

                • 本文介绍了编写 CoffeeScript 时有没有办法捕捉错别字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  这个小的 CoffeeScript 包含一个错字

                  This small CoffeeScript contains a typo

                  drinks = "Coffee"
                  drinks = drinks + ", " + "Tea"
                  drinsk = drinks + ", " + "Lemonade"
                  alert drinks
                  

                  本意是提醒咖啡、茶、柠檬水",但结果却是咖啡、茶".生成的 JavaScript 仍然有效并通过 JSLint;它在使用前声明变量很好,但它的变量错误.

                  The intention was to alert "Coffee, Tea, Lemonade" but the result is instead "Coffee, Tea". The generated JavaScript is still valid and passes JSLint; it declares the variables before usage which is good, but its the wrong variables.

                  var drinks, drinsk;
                  drinks = "Coffee";
                  drinks = drinks + ", " + "Tea";
                  drinsk = drinks + ", " + "Lemonade";
                  alert(drinks);
                  

                  如果同样的例子是用纯 JavaScript 编写的,那么 JSLint 会捕捉到错误:

                  If the same example was written in plain JavaScript then JSLint would catch the error:

                  var drinks;
                  drinks = "Coffee";
                  drinks = drinks + ", " + "Tea";
                  drinsk = drinks + ", " + "Lemonade";
                  alert(drinks);
                  
                  ------------------
                  Problem at line 4 character 1: 'drinsk' was used before it was defined.
                  drinsk = drinks + ", " + "Lemonade";
                  

                  问题:有没有办法保留我犯的错误以便我找到它们?我希望看到像 JSLint 这样的工具仍然有效.

                  To the question: Is there a way to keep the errors I make so that I can find them? I would love to see tools like JSLint still work.

                  也试过 http://www.coffeelint.org/ 它告诉我你的代码是 lint免费!"

                  Also tried http://www.coffeelint.org/ and it tells me "Your code is lint free!"

                  推荐答案

                  您可以使用支持标识符拼写检查的IDE,例如IntelliJ IDEA,顺便说一句,它有一个用于CoffeScript编辑的插件.

                  You can use IDE which supports identifier spellchecking, for example, IntelliJ IDEA which BTW has a plugin for CoffeScript editing.

                  这篇关于编写 CoffeeScript 时有没有办法捕捉错别字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何使用 WebStorm IDE 在我的 Meteor 应用程序中调试 CoffeeScript 下一篇:VueJS - 如何使用 ajax 调用的结果动态初始化模板

                  相关文章

                  1. <legend id='GV2pJ'><style id='GV2pJ'><dir id='GV2pJ'><q id='GV2pJ'></q></dir></style></legend>

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

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