I was wondering if anyone could explain to me why in the circular linked list example, on the insert method, why is it necessary to check if current.next is null. When exactly could node.next be null, if the tail of the linked list always keeps a reference to head?
if (node.next === null){ //update in case last element
node.next = head;
}