Skip to content

Commit

Permalink
Update my_list.js (#1511)
Browse files Browse the repository at this point in the history
修改insert注释
bongbongbakudan authored Sep 24, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 2737357 commit c12d01a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codes/javascript/chapter_array_and_linkedlist/my_list.js
Original file line number Diff line number Diff line change
@@ -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];
}

0 comments on commit c12d01a

Please sign in to comment.