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

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                返回指定的值在數組中的最后一個匹配項的索引。 ## 語法 ~~~ array1.lastIndexOf(searchElement[, fromIndex]) ~~~ ## 參數 |參數|定義| |--|--| |array1|必需。要搜索的數組對象。| |searchElement|必需。要在 array1 中定位的值。| |fromIndex|可選。用于開始搜索的數組索引。如果省略 fromIndex,則搜索將從數組中的最后一個索引處開始。| ## 返回值 數組中的 searchElement 的最后一個匹配項的索引;如果未找到 searchElement,則為 -1。 ## 備注 lastIndexOf 方法在數組中搜索指定的值。該方法返回第一個匹配項的索引;如果找不到指定的值,則為 -1。 搜索按降序索引順序進行(首先搜索最后一個成員)。若要按升序順序搜索,請使用 indexOf 方法 (Array) (JavaScript)。 數組元素將與 searchElement 值進行全等比較,與使用 === 運算符進行的比較類似。有關更多信息,請參見比較運算符 (JavaScript)。 可選 fromIndex 參數指定用于開始搜索的數組索引。如果 fromIndex 大于或等于數組長度,則搜索整個數組。如果 fromIndex 為負,則搜索從數組長度加上 fromIndex 的位置處開始。如果計算所得的索引小于 0,則返回 -1。 下面的示例闡釋了 lastIndexOf 方法的用法。 ~~~ // Create an array. var ar = ["ab", "cd", "ef", "ab", "cd"]; // Determine the first location, in descending order, of "cd". document.write(ar.lastIndexOf("cd") + "<br/>"); // Output: 4 // Find "cd" in descending order, starting at index 2. document.write(ar.lastIndexOf("cd", 2) + "<br/>"); // Output: 1 // Search for "gh" (which is not found). document.write(ar.lastIndexOf("gh")+ "<br/>"); // Output: -1 // Find "ab" with a fromIndex argument of -3. // The search in descending order starts at index 3, // which is the array length minus 2. document.write(ar.lastIndexOf("ab", -3) + "<br/>"); // Output: 0 ~~~
                  <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>

                              哎呀哎呀视频在线观看