Circular Singly Linked List | Insertion |  ; This function is only for empty list ; Creating a node dynamically . ; Assigning the data . ; Note : list was empty . We link single node to itself .
function addToEmpty ( last , data ) { if ( last != null ) return last ; var temp = new Node ( ) ; temp . data = data ; last = temp ; temp . next = last ; return last ; }