<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國際加速解決方案。 廣告
                ``` const?getType?=?(obj)?=>?Object.prototype.toString.call(obj).slice(8,?-1); ``` 使用示例 ``` const getType = (obj) => Object.prototype.toString.call(obj).slice(8, -1); let a = {}; let b = []; let c = "string"; let d = 12; let e = function test(){ } let f = null; let g = undefined; let h = true; console.log(getType(a));//Object console.log(getType(b));//Array console.log(getType(c));//String console.log(getType(d));//Number console.log(getType(e));//Function console.log(getType(f));//Null console.log(getType(g));//Undefined console.log(getType(h));//Boolean ``` 這個函數也是大家從juqery代碼里學來的,一直沿用到現在,也是極為推崇的判斷類型的方法,因為它非常準確。 ``` const?getType?=?(obj)?=>?Object.prototype.toString.call(obj).slice(8,?-1); exportfunction?isArray(obj:?any):?obj?is?any[]?{ return?getType(obj)?===?'Array'; } exportfunction?isObject(obj:?any):?obj?is?{ [key:?string]:?any?}?{ return?getType(obj)?===?'Object'; } exportfunction?isString(obj:?any):?obj?is?string?{ return?getType(obj)?===?'String'; } exportfunction?isNumber(obj:?any):?obj?is?number?{ return?getType(obj)?===?'Number'?&&?obj?===?obj; } exportfunction?isRegExp(obj:?any)?{ return?getType(obj)?===?'RegExp'; } exportfunction?isFile(obj:?any):?obj?is?File?{ return?getType(obj)?===?'File'; } exportfunction?isBlob(obj:?any):?obj?is?Blob?{ return?getType(obj)?===?'Blob'; } exportfunction?isUndefined(obj:?any):?obj?is?undefined?{ return?obj?===?undefined; } exportfunction?isFunction(obj:?any):?obj?is?(...args:?any[])?=>?any?{ return?typeof?obj?===?'function'; } exportfunction?isEmptyObject(obj:?any):?boolean?{ return?isObject(obj)?&&?Object.keys(obj).length?===?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>

                              哎呀哎呀视频在线观看