(index)
| 66 | } |
| 67 | |
| 68 | removeAt(index) { |
| 69 | let i = 0; |
| 70 | let cur = this.head; |
| 71 | let prev = null; |
| 72 | |
| 73 | while (cur != null) { |
| 74 | if (i == index) { |
| 75 | // remove |
| 76 | if (prev == null) |
| 77 | this.head = cur.next; |
| 78 | else prev.next = cur.next; |
| 79 | cur.next = null; |
| 80 | return cur.value; |
| 81 | } |
| 82 | else { |
| 83 | prev = cur; |
| 84 | cur = cur.next; |
| 85 | i++; |
| 86 | } |
| 87 | } |
| 88 | return null; |
| 89 | } |
| 90 | |
| 91 | insertAt(index, value) { |
| 92 | if (index == 0) return this.prepend(value); |
nothing calls this directly
no outgoing calls
no test coverage detected