Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vamsitallapudi/23fa659f6ccbd0e6ce88a93920d4dc2e to your computer and use it in GitHub Desktop.
Save vamsitallapudi/23fa659f6ccbd0e6ce88a93920d4dc2e to your computer and use it in GitHub Desktop.
val list = listOf(1, 3, 5, 7, 9)
// a function taking a single function as a parameter
list.forEach({ println(it) }) //it -> iterator which iterates and gives each value of list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment