Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- removeAt(index) {
- if (!this.head) {
- return;
- }
- if (index === 0) {
- this.head = this.head.next
- return;
- }
- const previous = this.getAt(index - 1)
- if (!previous || !previous.next) {
- return;
- }
- previous.next = previous.next.next
- }
Add Comment
Please, Sign In to add comment