哪些原型对象包含检测属性,需沿原型链向上追溯?
- 内容介绍
- 文章标签
- 相关推荐
本文共计47个文字,预计阅读时间需要1分钟。
javascriptprotoProperty=function(object, property) { var arr=[]; while(object) { if(object.hasOwnProperty(property)) { arr.push(object); } object=object.__proto__; } console.log(arr);}
protoPropertyfunction protoProperty(object,property){ var arr = []; while(object){ if(object.hasOwnProperty(property)){ arr.push(object); } object=object.__proto__; } console.dir(arr); }
本文共计47个文字,预计阅读时间需要1分钟。
javascriptprotoProperty=function(object, property) { var arr=[]; while(object) { if(object.hasOwnProperty(property)) { arr.push(object); } object=object.__proto__; } console.log(arr);}
protoPropertyfunction protoProperty(object,property){ var arr = []; while(object){ if(object.hasOwnProperty(property)){ arr.push(object); } object=object.__proto__; } console.dir(arr); }

