javascript compare array of strings