This commit is contained in:
krahets
2023-02-09 04:43:12 +08:00
parent af3542e3c0
commit 4d2575be7a
18 changed files with 264 additions and 156 deletions
+6
View File
@@ -1101,6 +1101,12 @@ comments: true
// 更新列表容量
l.numsCapacity = len(l.nums)
}
/* 返回有效长度的列表 */
func (l *myList) toArray() []int {
// 仅转换有效长度范围内的列表元素
return l.nums[:l.numsSize]
}
```
=== "JavaScript"