JavaScript length 屬性
實例
返回數組的數目:
fruits.length;
The result could be
4
定義和用法
length 屬性可設置或返回數組中元素的數目。
流覽器支持
![]()
![]()
![]()
![]()
![]()
所有主要流覽器都支持length 屬性。
語法
設置數組的數目:
array.length=number
Return the length of an array:
array.length
技術細節
| 返回值: | 一個數字,表示數組中的對象的元素數目。 |
|---|---|
| JavaScript 版本: | 1.1 |
JavaScript 數組對象
