mirror of
https://github.com/wangdoc/javascript-tutorial.git
synced 2025-12-23 18:54:57 +08:00
docs(types): edit array
This commit is contained in:
@@ -124,7 +124,7 @@ arr.length // 1001
|
||||
|
||||
上面代码表示,数组的数字键不需要连续,`length`属性的值总是比最大的那个整数键大`1`。另外,这也表明数组是一种动态的数据结构,可以随时增减数组的成员。
|
||||
|
||||
`length`属性是可写的。如果人为设置一个小于当前成员个数的值,该数组的成员会自动减少到`length`设置的值。
|
||||
`length`属性是可写的。如果人为设置一个小于当前成员个数的值,该数组的成员数量会自动减少到`length`设置的值。
|
||||
|
||||
```javascript
|
||||
var arr = [ 'a', 'b', 'c' ];
|
||||
|
||||
Reference in New Issue
Block a user