Implementing Iterator pattern of a single Linked List | creating a list ; elements to be added at the end . in the above created list . ; elements of list are retrieved through iterator .
var list = [ ] ; list . push ( 1 ) ; list . push ( 2 ) ; list . push ( 3 ) ; for ( var i = 0 ; i < list . length ; i ++ ) { document . write ( list [ i ] + " " ) ; }