LeetCode #237 - Delete Node in a Linked List

const deleteNode = node => {
    if (node.next) {
        node.val = node.next.val;
        node.next = node.next.next;
    }
}