<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國際加速解決方案。 廣告
                # Array 數組對象 [TOC]   提供對創建任何數據類型的數組的支持。 ## 數組的創建 ~~~ <script> var arr = ['hello','rose','think']; console.log(arr); // ["hello", "rose", "think"] var arr = new Array(); arr[0] = 'hello'; arr[1] = 'world'; console.log(arr); // ["hello", "world"] </script> ~~~ ## 數組的訪問 通過制定數組名以及索引號可以訪問某個特定的元素。 >[info] [0]是數組的第一個元素 [1]是數組的第二個元素 ## 數組常用的方法 ### concat方法 合并數組 ~~~ <script> var arr_1 = ['hello','world']; var arr_2 = ['rose','curder']; var arr_3 = arr_1.concat(arr_2); console.log(arr_3); // ["hello", "world", "rose", "curder"] </script> ~~~ ### sort方法 數組排序 ~~~ <script> var arr_1 = ['a','c','d','z','e']; var arr_2 = ['3','5','6','2','1']; console.log(arr_1.sort()); // ["a", "c", "d", "e", "z"] console.log(arr_2.sort()); // ["1", "2", "3", "5", "6"] console.log(arr_2.sort(function(a,b){return b-a;})); // ["6", "5", "3", "2", "1"] 降序排列 </script> ~~~ ### push方法 末尾追加元素 ~~~ <body> <script> var arr_1 = [1,2,3,4]; arr_1.push(5); // 末尾追加 console.log(arr_1); // [1, 2, 3, 4, 5] </script> ~~~ ### reverse方法 數組元素翻轉 ~~~ <script> var arr = ['d','a','c']; console.log(arr.reverse()); // ["c", "a", "d"] </script> ~~~
                  <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>

                              哎呀哎呀视频在线观看