<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國際加速解決方案。 廣告
                返回滿足回調函數中指定的測試條件的第一個數組元素的索引值。 ## 語法 ~~~ arrayObj.findIndex(callbackfn [, thisArg]); ~~~ ## 參數 |參數|定義| |--|--| |arrayObj|必需。數組對象。| |callbackfn|必需。用于測試數組中的每個元素的回調函數。| |thisArg|可選。指定回調函數中的 this 對象。如果未指定,則未定義 this 對象。| ## 備注 對于數組中的每個元素,findIndex 方法都會調用一次回調函數(采用升序索引順序),直到有元素返回 true。只要有一個元素返回 true,findIndex 立即返回該返回 true 的元素的索引值。如果數組中沒有任何元素返回 true,則 findIndex 返回 -1。 findIndex 不會改變數組對象。 ### 回調函數語法 回調函數的語法如下所示: ~~~ function callbackfn(value, index, thisArg) ~~~ 你可使用最多三個參數來聲明回調函數。 回調函數的參數如下所示。 |回調參數|定義| |--|--| |Value|數組元素的值。| |index|數組元素的數字索引。| |arrayObj|要遍歷的數組對象。| 在下面的示例中,回調函數測試數組中的每個元素是否都等于 2。 ~~~ [1,2,3].findIndex(function(x) { x == 2; }); // Returns an index value of 1. ~~~ 下面的示例使用箭頭語法來測試每個元素。在此示例中,沒有任何元素返回 true,findIndex 返回 -1。 ~~~ [1,2,3].findIndex(x => x == 4); // Returns an index value of -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>

                              哎呀哎呀视频在线观看