
<script>
var x=Object.getOwnPropertyNames(HTMLCollection.prototype);
var len=x.length;
for(let i=0;i<len;i++){
document.write(x[i]+" , ");
}
</script>
却发现有length!var x=Object.getOwnPropertyNames(HTMLCollection.prototype);
var len=x.length;
for(let i=0;i<len;i++){
document.write(x[i]+" , ");
}
</script>
于是我又编了一段程序:
<script>
document.write(HTMLCollection.prototype.length);
</script>
居然抛出错误document.write(HTMLCollection.prototype.length);
</script>
有人能给出解释吗