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 177 views
177 views asked Dec 14, 2024 by avibootz
1 answer 211 views
1 answer 188 views
1 answer 219 views
2 answers 222 views
1 answer 174 views
...