22集 歷史查詢實現本地存儲

當原型函數:Person
構造函數:plan1
1:原型函數Person以及plan1構造函數都沒有hasOwnproperty方法為什么plan1還可以使用hasOwnproperty方法呢?是因為咱們Object對象存在這個方法,所以構造函數plan1是可以使用hasOwnproperty方法的,查找方式:plan1->Person->Object(原型鏈的作用)
2:構造函數的__proto__屬性是指向原型函數的prototype屬性的即plan1.__proto__==Person.prototype
3:構造函數會通過原型鏈一直查找屬性直到查找到null還是沒有找到的話就會報錯
4:構造函數是經過原型函數new出來的實列對象
標簽: