Driver code
var head = newNode ( 1 ) ; head . next = newNode ( 9 ) ; head . next . next = newNode ( 9 ) ; head . next . next . next = newNode ( 9 ) ; document . write ( " " ) ; printList ( head ) ; head = addOne ( head ) ; document . write ( " " ) ; document . write ( " " ) ; printList ( head ) ;