let hasPubProperty = function hasPubProperty(obj,attr){
return (attr in obj) && obj.hasOwnProperty(attr);
}
Object.prototype.hasPubProperty = function hasPubProperty(attr){
let self = this;
let protoType = Object.getPrototypeOf(self);
while(protoType){
if(protoType.hasOwnProperty(attr))return true;
protoType = Object.getPrototypeOf(protoType);
}
return false;
}
Object.prototype.hasPubProperty = function hasPubProperty(attr){
let protoType = Object.getPrototypeOf(self);
return attr in protoType;
}