Javascript Loop Through Array And String