0
Help with Kotlin 22.2 practice
Iâm having difficulties with this code challenge. Can anyone help please and thank you You are given code that should iterate through an array and output the first letters of each element. However, the code has errors. Fix the code to result in the expected output. //. My code here https://sololearn.com/coach/1137/?ref=app
2 Answers
+ 3
fun main(args: Array<String>) {
var arr = arrayOf("James", "Amy", "Sam", "Olie", "Bob")
arr.forEach() {
item -> print(item[0])
}
}
+ 1
SoloProg thank you!!! Much appreciated