Swift Loop Through Array Javascript Length Of String