Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vamsitallapudi/54da170172613927e3f3ee02dcd1e609 to your computer and use it in GitHub Desktop.
Save vamsitallapudi/54da170172613927e3f3ee02dcd1e609 to your computer and use it in GitHub Desktop.
val list = listOf(1, 3, 5, 7, 9)
// fold function is taking a parameter and a lambda expression
println(list.fold(1, { a, b -> a * b }))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment