Question - What is the forEach in Kotlin?
Answer -
In Kotlin, to use the functionality of a for-each loop just like in Java, we use a forEach function. The following is an example of the same:
var listOfMindOrks = listOf("mindorks.com", "blog.mindorks.com", "afteracademy.com")
listOfMindOrks.forEach {
Log.d(TAG,it)
}