Swift Loop Through Array Javascript Length Function In C