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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                > 展開運算符,將一個數組轉為用逗號分隔的參數序列 ~~~ //合并數組 let a = [1,2,3]; let b = [4,5,6]; let c = [...a,...b]; // [1,2,3,4,5,6] //替代apply function f(a,b,c){ console.log(a,b,c) } let args = [1,2,3]; // 以下三種方法結果相同 f.apply(null,args) f(...args) f(1,2,3) function f2(...args){ console.log(args) } f2(1,2,3) // [1,2,3] function f3(){ console.log(Array.from(arguments)) } f3(1,2,3) // [1,2,3] Array.from() 可以通過以下方式來創建數組對象: //偽數組對象(擁有一個 length 屬性和若干索引屬性的任意對象) //可迭代對象(可以獲取對象中的元素,如 Map和 Set 等) let a = [1,2,3]; let b = [4,5,6]; Array.prototype.push.apply(a,b); // 或 a.push(...b) // 兩種方法取其一 //解構賦值 let a = [1,2,3,4,5,6] let [c,...d] = a console.log(c); // 1 console.log(d); // [2,3,4,5,6] //展開運算符必須放在最后一位字符串轉為數組,正確識別 32 位的 Unicode 字符 [...'siva'] // ['s','i','v','a'] [...'x\uD83D\uDE80y'].length // 3 //具有 Iterator 接口的對象,轉換成數組 var nodelist = document.querySelectorAll('div'); console.log([...nodelist]) // 轉化成數組 var map = new Map([[1,11],[2,22],[3,33]]); console.log([...map.keys()]); // [1,2,3] //淺拷貝 //數組 var a = [1,2,4] var b = [...a] a.push(6) console.log(b) // [1,2,4] //對象 var a = {a:1} var b = {...a} a.a = 5 console.log(b.a) // 1 ~~~
                  <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>

                              哎呀哎呀视频在线观看