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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                返回某個值在數組中的第一個匹配項的索引。 ## 語法 ~~~ array1.indexOf(searchElement[, fromIndex]) ~~~ ## 參數 |參數|定義| |--|--| |array1|必需。一個數組對象。| |searchElement|必需。要在 array1 中定位的值。| |fromIndex|可選。用于開始搜索的數組索引。如果省略 fromIndex,則從索引 0 處開始搜索。| ## 返回值 數組中的 searchElement 的第一個匹配項的索引;如果未找到 searchElement,則為 -1。 ## 備注 indexOf 方法在數組中搜索指定的值。該方法返回第一個匹配項的索引;如果找不到指定的值,則為 -1。 按升序索引順序執行搜索。 數組元素將與 searchElement 值進行全等比較,與 === 運算符類似。 可選 fromIndex 參數指定用于開始搜索的數組索引。如果 fromIndex 大于或等于數組長度,則返回 -1。如果 fromIndex 為負,則搜索從數組長度加上 fromIndex 的位置處開始。 下面的示例闡釋了 indexOf 方法的用法。 ~~~ // Create an array. (The elements start at index 0.) var ar = ["ab", "cd", "ef", "ab", "cd"]; // Determine the first location of "cd". document.write(ar.indexOf("cd") + "<br/>"); // Output: 1 // Find "cd" starting at index 2. document.write(ar.indexOf("cd", 2) + "<br/>"); // Output: 4 // Find "gh" (which is not found). document.write (ar.indexOf("gh")+ "<br/>"); // Output: -1 // Find "ab" with a fromIndex argument of -2. // The search starts at index 3, which is the array length plus -2. document.write (ar.indexOf("ab", -2) + "<br/>"); // Output: 3 ~~~
                  <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>

                              哎呀哎呀视频在线观看