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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 檢測對象是公有還是私有 <br> ## 1.in關鍵字 >[danger]**判斷該屬性是否存在對象中** 無論判斷的成員是屬于當前實例對象(私有)還是屬于其原型對象(公有)的,in都返回**true**,如果都不存在,則返回**false**。 ***** <br> ~~~javascript //構造函數 function Person(name,age) { this.name = name;/*靜態成員,私有屬性*/ this.age = age; } // 把方法放在原型上 Person.prototype = { constructor:Person,/*修改this指向*/ say:function () {/*原型屬性,公有屬性*/ console.log("世界,你好"); }, }; // 實例化對象 var per = new Person("wc",3); console.log(per); console.log("name" in per);/* true*/ console.log("say" in per);/* true*/ console.log("sex" in per);/*false*/ ~~~ ***** ## 2.hasOwnProperty屬性 >[danger]判斷該對象是否存在實例對象(私有)中,不能訪問原型對象(公有),存在返回true ,不存在返回false ***** ~~~javascript console.log(per.hasOwnProperty("name"));/*true*/ console.log(per.hasOwnProperty("sex"));/*false 實例對象中不存在這個屬性*/ console.log(per.hasOwnProperty("say"));/*say 是公有的,不能訪問得到,所以返回的是false*/ ~~~
                  <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>

                              哎呀哎呀视频在线观看