<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                >[success] # includes 和 indexof ~~~ 1.簡單的使用體驗上這兩個api 都可以做一個屬性是否是在數組中存在,細節上本質來說 indexof 采用的是 '===',incluedes 采用的和map set 比較相同元素一樣的特性'SameVauleZero' 也就是類似'Object.is'api 特性可以用來判斷Nan ~~~ >[danger] ##### includes 和 indexof 都有第二個參數fromIndex ~~~ 1.非必填,默認是0,從該索引處開始搜索。如果是正值,且formIndex >= Array.length,則必定搜索不到結果。 如果是負值,且0 <= (Array.length+formIndex) < Array.length,則從(Array.length+formIndex)開始搜索; 如果是負值,且(Array.length+formIndex) < 0,則從位置0開始搜索。 ~~~ ~~~ const flag = [1, 2, 3].includes(3, 3); // false const flag1 = [1, 2, 3].includes(3, 2); // true console.log(flag,flag1); ~~~ >[danger] ##### 二者區別 ~~~ 1.includes 可以區分NaN indexof 不能 ~~~ ~~~ const ls = [1, 2, +0,-0,NaN] const flag = ls.includes(NaN); // true const flag1 = ls.includes(0); // true const flag2 = ls.includes(+0); // true const flag3 = ls.includes(-0); // true const flag4 = ls.indexOf(NaN); // -1 const flag5 = ls.indexOf(0); // 2 const flag6 = ls.indexOf(+0); // 2 const flag7 = ls.indexOf(-0); // 2 console.log(flag,flag1,flag2,flag3); console.log(flag4,flag5,flag6,flag7); ~~~
                  <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>

                              哎呀哎呀视频在线观看