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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                * var 的問題 * 可以重復聲明,沒有報錯和警告 * 無法限制修改 * 沒有塊級作用域,`{ }` * let 和 const * 不能重復聲明 * 都是塊級作用域,`{ }`塊內聲明的,塊外無效 * let 是變量,可以修改 * const 是常量,不能修改 * 塊級作用域舉例 * 原來用 var 的方式,結果彈出的都是 3 * 或者將變量 封裝到函數里,限制作用域,但比較麻煩 * 用 let 最簡單,直接 var 改 let,解決作用域問題 let 變量命 ``` let name="dash" //let不能重復聲明了。也不存在變量提升 ``` const 常量名 ``` //一定要初始值 const SEX="男" ``` 解構賦值 ``` //數組解構 const F4 =['小沈陽','劉能',"趙四","宋小寶"] let [x,l,z,s]=F4; //對象解構 const zhao={ name:"zhaobenshan", age:60, say:function(){ console.log("123") } } let {n,a,say}=zhao; say(); ``` 引入新的字符串聲明方式\`\` ``` let str=`123` 變量拼接${} let age=20; let str=`我叫匿名,今年${age}歲` ``` 字符串多了兩個新方法 * `startsWith` * `endsWith` ~~~js var url = 'http://qq.com' console.log(url.startsWith('http')) console.log(url.endsWith('com')) // 都是 true ~~~ Number.EPSILON 是表示最小精度 ``` function equal(a,b){ if(Math.abs(a-b)<Number.EPSILON){ return true; }else{ return false; } } console.log(0.1+0.2===0.3);//false console.log(equal(0.1+0.2, 0.3));//true ``` //1. Object.is判斷兩個值是否完全相等 //2. object.assign對象的合并 //3. object. setPrototypeof 與 object.getPrototypeof 對象簡寫 ``` let name="dash"; let say=function(){} const sc={ name, say, eat(){} } 相當于 const sc={ name:name, say:say, eat:function(){} } ```
                  <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>

                              哎呀哎呀视频在线观看