Array.length与Array.prototype.length [英] Array.length vs Array.prototype.length

查看:94
本文介绍了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,

PrototypeisArray可用,但是如何使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆