While Loop Through String Array In Javascript