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

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                模塊化主要是用來抽離公共代碼,隔離作用域,避免變量沖突等。 **IIFE**: 使用自執行函數來編寫模塊化,特點:**在一個單獨的函數作用域中執行代碼,避免變量沖突**。 ~~~js (function(){ return { data:[] } })() ~~~ **AMD**: 使用requireJS 來編寫模塊化,特點:**依賴必須提前聲明好**。 ~~~js define('./index.js',function(code){ // code 就是index.js 返回的內容 }) ~~~ **CMD**: 使用seaJS 來編寫模塊化,特點:**支持動態引入依賴文件**。 ~~~js define(function(require, exports, module) { var indexCode = require('./index.js'); }); ~~~ **CommonJS**: nodejs 中自帶的模塊化。 ~~~js var fs = require('fs'); ~~~ **UMD**:兼容AMD,CommonJS 模塊化語法。 **webpack(require.ensure)**:webpack 2.x 版本中的代碼分割。 **ES Modules**: ES6 引入的模塊化,支持import 來引入另一個 js 。 ~~~js import a from 'a'; ~~~ ## 摘自 [前端中的模塊化開發](https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/28)
                  <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>

                              哎呀哎呀视频在线观看