deleteAnyNode(value) {
// contact me !!!
// linkedIn account : https://www.linkedin.com/in/mohammad-alshraideh-67820b186/
if (!this.head) return null;
let current = this.head;
while (current.next) {
if (current.value == value) {
current.value = current.next.value;
current.next = current.next.next;
}
current = current.next;
}
return current;
}
//if you find the answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)