Update my_list.js (#1511)

修改insert注释
This commit is contained in:
bongbongbakudan 2024-09-24 17:57:34 +08:00 committed by GitHub
parent 2737357242
commit c12d01a752
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,7 +70,7 @@ class MyList {
remove(index) {
if (index < 0 || index >= this.#size) throw new Error('索引越界');
let num = this.#arr[index];
// 将索引 index 之后的元素都向前移动一位
// 将索引 index 之后的元素都向前移动一位
for (let j = index; j < this.#size - 1; j++) {
this.#arr[j] = this.#arr[j + 1];
}