Array.length与Array.prototype.length [英] Array.length vs Array.prototype.length
本文介绍了Array.length与Array.prototype.length的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我发现Array
对象和Array.prototype
都具有length
属性.我对使用Array.length
属性感到困惑.您如何使用它?
I found that both the Array
Object and Array.prototype
have the length
property. I am confused on using the Array.length
property. How do you use it?
Console.log(Object.getOwnpropertyNames(Array));//As per Internet Explorer
输出:
length,arguments,caller,prototype,isArray,
Prototype
和isArray
可用,但是如何使用length
属性?
Prototype
and isArray
is usable but how do you use the length
property?
推荐答案
Array
是构造函数.
所有函数都有一个length
属性,该属性返回函数定义中已声明参数的数量.
All functions have a length
property that returns the number of declared parameters in the function definition.
这篇关于Array.length与Array.prototype.length的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文