<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                * [22.1](https://github.com/yuche/javascript#22.1)?避免單字母命名。命名應具備描述性。 ~~~ // bad function q() { // ...stuff... } // good function query() { // ..stuff.. } ~~~ * [22.2](https://github.com/yuche/javascript#22.2)?使用駝峰式命名對象、函數和實例。 ~~~ // bad const OBJEcttsssss = {}; const this_is_my_object = {}; function c() {} // good const thisIsMyObject = {}; function thisIsMyFunction() {} ~~~ * [22.3](https://github.com/yuche/javascript#22.3)?使用帕斯卡式命名構造函數或類。 ~~~ // bad function user(options) { this.name = options.name; } const bad = new user({ name: 'nope', }); // good class User { constructor(options) { this.name = options.name; } } const good = new User({ name: 'yup', }); ~~~ * [22.4](https://github.com/yuche/javascript#22.4)?使用下劃線?`_`?開頭命名私有屬性。 ~~~ // bad this.__firstName__ = 'Panda'; this.firstName_ = 'Panda'; // good this._firstName = 'Panda'; ~~~ * [22.5](https://github.com/yuche/javascript#22.5)?別保存?`this`?的引用。使用箭頭函數或 Function#bind。 ~~~ // bad function foo() { const self = this; return function() { console.log(self); }; } // bad function foo() { const that = this; return function() { console.log(that); }; } // good function foo() { return () => { console.log(this); }; } ~~~ * [22.6](https://github.com/yuche/javascript#22.6)?如果你的文件只輸出一個類,那你的文件名必須和類名完全保持一致。 ~~~ // file contents class CheckBox { // ... } export default CheckBox; // in some other file // bad import CheckBox from './checkBox'; // bad import CheckBox from './check_box'; // good import CheckBox from './CheckBox'; ~~~ * [22.7](https://github.com/yuche/javascript#22.7)?當你導出默認的函數時使用駝峰式命名。你的文件名必須和函數名完全保持一致。 ~~~ function makeStyleGuide() { } export default makeStyleGuide; ~~~ * [22.8](https://github.com/yuche/javascript#22.8)?當你導出單例、函數庫、空對象時使用帕斯卡式命名。 ~~~ const AirbnbStyleGuide = { es6: { } }; export default AirbnbStyleGuide; ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看