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/f3f0c3df7e597d3266ad35f016f60c78 to your computer and use it in GitHub Desktop.
Save vamsitallapudi/f3f0c3df7e597d3266ad35f016f60c78 to your computer and use it in GitHub Desktop.
val list = listOf(1, 3, 5, 7, 9)
// if the lambda expression is the last parameter, we can move the parameter out
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