<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                >[info] **[Array.from](https://www.ecma-international.org/ecma-262/6.0/#sec-array.from)** (ES6) ~~~ Array.from(arrayLike[, mapFn[, thisArg]]) ~~~ `arrayLike` 想要轉換成數組的偽數組對象或可迭代對象。 `mapFn` 可選, 如果指定了該參數,新數組中的每個元素會執行該回調函數。 `thisArg` 可選參數,執行回調函數`mapFn`時`this`對象。 `返回值` 新數組實例。 &nbsp; ***** &nbsp; >[info] **[Array.isArray](https://tc39.es/ecma262/#sec-array.isarray)** (ES5) > 檢測一個值是否為數組 ~~~ Array.isArray(obj) ~~~ `返回值` 布爾值。 &nbsp; ***** &nbsp; >[info] **[Array.of](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/of)** (ES6) ~~~ Array.of(element0[,?element1[, ...[,?elementN]]]) ~~~ `elementN` 任意個參數,將按順序成為返回數組中的元素。 `返回值` 新的 Array 實例。 &nbsp; ***** &nbsp; >[info] **[Array.prototype.map](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/map)** (ES5) > 方法創建一個新數組,其結果是該數組中的每個元素是調用一次提供的函數后的返回 &nbsp; ***** &nbsp; >[info] **[Array.prototype.forEach](https://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18)** (ES5) > 數組循環遍歷 ~~~ arr.forEach(callback(currentValue [, index [, array]])[, thisArg]) ~~~ `callback` 為數組中每個元素執行的函數,該函數接收一至三個參數: `currentValue`數組中正在處理的當前元素。 `index`可選, 數組中正在處理的當前元素的索引。 `array`可選, forEach() 方法正在操作的數組。 `thisArg`可選, 當執行回調函數`callback`時,用作`this`的值。 `返回值` undefined >[danger] **注意** > `forEach()`遍歷的范圍在第一次調用`callback`前就會確定。調用`forEach`后添加到數組中的項不會被`callback`訪問到。 > 如果已經存在的值被改變,則傳遞給`callback`的值是`forEach()`遍歷到他們那一刻的值。已刪除的項不會被遍歷到。 > 如果已訪問的元素在迭代時被修改了(例如使用[`shift()`](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)),之后的元素將被跳過。 &nbsp; ***** &nbsp; >[info] **[Array.prototype.some()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/some)** (ES5) > 測試數組中是不是至少有1個元素通過了被提供的函數測試。它返回的是一個Boolean類型的值。 ~~~ arr.every(callback(element[, index[, array]])[, thisArg]) ~~~ `callback` 用來測試每個元素的函數,它可以接收三個參數: `element` 用于測試的當前值。 `index` 可選, 用于測試的當前值的索引。 `array` 可選, 調用`every`的當前數組。 `thisArg` 執行`callback`時使用的?`this`?值。 `返回值` 數組中有至少一個元素通過回調函數的測試就會返回`true`;所有元素都沒有通過回調函數的測試返回值才會為false。 &nbsp; ***** &nbsp; >[info] **[Array.prototype.every()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/every)** (ES5) > 測試一個數組內的所有元素是否都能通過某個指定函數的測試 ~~~ arr.every(callback(element[, index[, array]])[, thisArg]) ~~~ `callback` 用來測試每個元素的函數,它可以接收三個參數: `element` 用于測試的當前值。 `index` 可選, 用于測試的當前值的索引。 `array` 可選, 調用`every`的當前數組。 `thisArg` 執行`callback`時使用的?`this`?值。 `返回值` 布爾值 &nbsp; ***** &nbsp; >[info] **[Array.prototype.includes()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)** (ES7) > 用來判斷一個數組是否包含一個指定的值,根據情況,如果包含則返回 true,否則返回false。 ~~~ arr.includes(valueToFind[,?fromIndex]) ~~~ `valueToFind` 需要查找的元素值。 `fromIndex` 可選, 從`fromIndex`索引處開始查找`valueToFind`。如果為負值,則按升序從`array.length +?fromIndex`?的索引開始搜 (即使從末尾開始往前跳`fromIndex`?的絕對值個索引,然后往后搜尋)。默認為 0。 >[danger] **注意** > 使用`includes()`比較字符串和字符時是區分大小寫。 &nbsp; ***** &nbsp; >[info] **[Array.prototype.filter()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)** (ES5) > 返回一個由通過指定測試方法的所有元素組成的新數組 ~~~ var newArray = arr.filter(callback(element[, index[, array]])[, thisArg]) ~~~ `callback` 用來測試數組的每個元素的函數。返回`true`表示該元素通過測試,保留該元素,`false`則不保留。它接受以下三個參數: `element` 數組中當前正在處理的元素。 `index` 可選,正在處理的元素在數組中的索引。 `array` 可選,調用了`filter`的數組本身。 `thisArg` 可選,執行`callback`時,用于`this`的值。 `返回值` 一個新的、由通過測試的元素組成的數組,如果沒有任何數組元素通過測試,則返回空數組。 &nbsp; ***** &nbsp; >[info]**[Array.prototype.find()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/find)** (ES6) ~~~ arr.find(callback[, thisArg]) ~~~ `callback` 在數組每一項上執行的函數,接收 3 個參數: `element` 當前遍歷到的元素。 `index` 可選, 當前遍歷到的索引。 `array` 可選, 數組本身。 `thisArg` 可選, 執行回調時用作`this`?的對象。 `返回值` 數組中第一個滿足所提供測試函數的元素的值,否則返回?[`undefined`](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/undefined)。 >[danger] **注意** 在第一次調用`callback`函數時會確定元素的索引范圍,因此在`find`方法開始執行之后添加到數組的新元素將不會被`callback`函數訪問到。如果數組中一個尚未被`callback`函數訪問到的元素的值被`callback`函數所改變,那么當`callback`函數訪問到它時,它的值是將是根據它在數組中的索引所訪問到的當前值。被刪除的元素仍舊會被訪問到,但是其值已經是undefined了。 &nbsp; ***** &nbsp; >[info]**[ Array.prototype.flat()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/flat)** (ES2019) `flat()`方法會按照一個可指定的深度遞歸遍歷數組,并將所有元素與遍歷到的子數組中的元素合并為一個新數組返回。 ~~~ var newArray = arr.flat([depth]) ~~~ `depth`可選, 指定要提取嵌套數組的結構深度,默認值為 1。 `返回值` 一個包含將數組與子數組中所有元素的新數組。 &nbsp; ***** &nbsp; >[info] **Array.prototype.concat** > 數組連接 ~~~ var new_array = old_array.concat(value1[, value2[, ...[, valueN]]]) ~~~ `valueN` 可選, 數組和/或值,將被合并到一個新的數組中。如果省略了所有`valueN`參數,則`concat`會返回調用此方法的現存數組的一個淺拷貝。詳情請參閱下文描述。 `返回值` 新的 Array 實例。 &nbsp; ***** &nbsp; >[info] **Array.prototype.pop()** > 從數組中刪除最后一個元素,并返回該元素的值 &nbsp; ***** &nbsp; >[info] **Array.prototype.push()** > 將一個或多個元素添加到數組的末尾,并返回該數組的新長度 &nbsp; ***** &nbsp; >[info] **[Array.prototype.shift()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)** > 從數組中刪除**第一個**元素,并返回該元素的值。此方法更改數組的長度。 &nbsp; ***** &nbsp; >[info] **[Array.prototype.unshift()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)** > 將一個或多個元素添加到數組的**開頭**,并返回該數組的**新長度(該**方法修改原有數組**)**。 &nbsp; ***** &nbsp; >[info] **[Array.prototype.reduce()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce)** > 方法對數組中的每個元素執行一個由您提供的**reducer**函數(升序執行),將其結果匯總為單個返回值。使用場景: 數組求和求積,數組扁平化等 &nbsp; ***** &nbsp; >[info] **[Array.prototype.reverse()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)** > 將數組中元素的位置顛倒,并返回該數組。數組的第一個元素會變成最后一個,數組的最后一個元素變成第一個。該方法會改變原數組。 &nbsp; ***** &nbsp; >[info] **[Array.prototype.slice()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)** > `slice()`方法返回一個新的數組對象,這一對象是一個由?`begin`和`end`決定的原數組的**淺拷貝**(包括`begin`,不包括`end`)。原始數組不會被改變。 &nbsp; ***** &nbsp; >[info] **[Array.prototype.sort()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)** > 排序 &nbsp; ***** &nbsp; >[info] **[Array.prototype.splice()](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)** > **`splice()`**方法通過刪除或替換現有元素或者原地添加新的元素來修改數組,并以數組形式返回被修改的內容。此方法會改變原數組。 `返回值` **由被刪除的元素組成的一個數組**。如果只刪除了一個元素,則返回只包含一個元素的數組。如果沒有刪除元素,則返回空數組。
                  <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>

                              哎呀哎呀视频在线观看