Created
December 12, 2021 20:18
-
-
Save magdamiu/0a318b1b20b5e00430bcf65cd019e874 to your computer and use it in GitHub Desktop.
Lambdas expressions & Closure (capturing lambda) | High performance with idiomatic Kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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