(index)
| 79 | } |
| 80 | |
| 81 | removeAt(index) { |
| 82 | let i = 0; |
| 83 | let cur = this.head; |
| 84 | let prev = null; |
| 85 | |
| 86 | while (cur != null) { |
| 87 | if (i == index) { |
| 88 | // remove |
| 89 | if (prev == null) |
| 90 | this.head = cur.next; |
| 91 | else prev.next = cur.next; |
| 92 | cur.next = null; |
| 93 | return cur.value; |
| 94 | } |
| 95 | else { |
| 96 | prev = cur; |
| 97 | cur = cur.next; |
| 98 | i++; |
| 99 | } |
| 100 | } |
| 101 | return null; |
| 102 | } |
| 103 | |
| 104 | insertAt(index, value) { |
| 105 | if (index == 0) return this.prepend(value); |
nothing calls this directly
no outgoing calls
no test coverage detected