Driver program to test above
let arr = [ 0 , 1 , 9 , 8 , 4 , 0 , 0 , 2 , 7 , 0 , 6 , 0 , 9 ] ; let n = arr . length ; document . write ( " " ) ; printArray ( arr , n ) ; moveZerosToEnd ( arr , n ) ; document . write ( " " + " " ) ; printArray ( arr , n ) ;