Closed
Description
The following code is correct.
removeByPosition(position = 0) {
const current = this.get(position);
if (position === 0) {
this.removeFirst();
} else if (position === this.size) {
this.removeLast();
}else if(current) {
current.previous.next = current.next;
current.next.previous = current.previous;
this.size -=1;
}
return current && current.value;
}
Metadata
Metadata
Assignees
Labels
No labels