JavaScript length 属性
最后更新于:2022-03-26 21:54:53
JavaScript length 属性
JavaScript 数组对象
实例
返回数组的数目:
fruits.length;
The result could be
4
尝试一下 »
定义和用法
length 属性可设置或返回数组中元素的数目。
浏览器支持





所有主要浏览器都支持length 属性。
语法
设置数组的数目:
Return the length of an array:
技术细节
返回值: |
一个数字,表示数组中的对象的元素数目。 |
JavaScript 版本: |
1.1 |
JavaScript 数组对象