Loading practice questions
Which function is used to iterate over a collection in Kotlin?
Correct Answer: B — forEach()
Explanation:
The forEach() function in Kotlin is used to iterate over a collection or array and execute a block of code for each element.