JavaScript length 属性
实例
返回数组的数目:
fruits.length;
The result could be
4
知识兔 »
定义和用法
length 属性可设置或返回数组中元素的数目。
浏览器支持
所有主要浏览器都支持length 属性。
语法
设置数组的数目:
array.length=number
Return the length of an array:
返回数组的数目:
fruits.length;
The result could be
4
length 属性可设置或返回数组中元素的数目。
所有主要浏览器都支持length 属性。
设置数组的数目:
Return the length of an array: