<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                **Object.keys()** **for...in** **Object.getOwnPropertyNames()** ~~~ var testObj = Object.create({}, { getFoo: { value: function () { return this.foo; }, enumerable: false } }); testObj.name = "shangguan"; testObj.age = 25; testObj.action = function(){ return this.name; }; var keys= Object.keys(testObj); console.log(keys); var keys =[]; for(var i in testObj){ keys.push(i); } console.log(keys); var keys = Object.getOwnPropertyNames(testObj); console.log(keys); ~~~ 所有繼承了?Object?的對象都會繼承到?`hasOwnProperty`?方法。這個方法可以用來檢測一個對象是否含有特定的自身屬性;和?in?運算符不同,該方法會忽略掉那些從原型鏈上繼承到的屬性。 ### 使用?`hasOwnProperty`?方法判斷屬自身屬性與繼承屬性 ~~~ function Demo(name){ this.name=name||'Tom';//自身屬性 } Demo.prototype.age='10'; var demo=new Demo('lilei');                //原型鏈的,非私有的屬性 console.log(demo.hasOwnProperty('age'));//false console.log(demo.hasOwnProperty('toString'));// 返回 false //自身屬性 console.log(demo.hasOwnProperty(name));//true ~~~
                  <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>

                              哎呀哎呀视频在线观看