Swift Loop Through Array Javascript Methods List