Javascript Array And String Questions Java