检测某一个属性名是否为当前对象的私有属性
“in”:检测这个属性是否属于某个对象(不管是私有属性还是公有属性,只要是它的属性,结果就为true)
let ary = [10,20,30]
console.log('0' in ary) //true
console.log('push' in ary ) //true
console.log(ary.hasOwnProperty('push')) //false push是它的公有属性,而不是私有属性
console.log(Array.prototype.hasOwnProperty('push')); //true 是公有还是私有,需要看相对谁来说
console.log(Object.prototype.hasOwnProperty('hasOwnProperty')) //true
//自己堆中有的就是私有属性,需要基于__proto__查找的就是公有属性
检测某个属性是否为对象的公有属性 :hasPubProperty
方法:是它的属性,但是不是他的私有的
我实在懒得听了下次再说吧