Skip to content

Instantly share code, notes, and snippets.

@magdamiu
Created Dec 12, 2021
Embed
What would you like to do?
Lambdas expressions & Closure (capturing lambda) | High performance with idiomatic Kotlin
var priceBooks = 0.0
val prefixPriceDetails = "The current sum is "
books.forEach {
priceBooks += it.price
println("$prefixPriceDetails $priceBooks")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment