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 365 views
365 views asked Dec 14, 2024 by avibootz
1 answer 303 views
1 answer 264 views
1 answer 306 views
2 answers 338 views
1 answer 258 views
...