Swift Loop Through Array Javascript Documentation