How to iterate over array using for-in loop in Swift

1 Answer

0 votes
let arr = ["swift", "c", "c++", "php", "java"]

for item in arr {
   print(item)
}





/*
run:
 
swift
c
c++
php
java
 
*/

 



answered Feb 7, 2021 by avibootz

Related questions

5 answers 180 views
180 views asked Dec 14, 2024 by avibootz
1 answer 217 views
1 answer 197 views
1 answer 223 views
2 answers 228 views
1 answer 183 views
...