From the Kotlin Koan question(
https://github.com/Kotlin/kotlin-koans/blob/master/src/ii_collections/n16FlatMap.kt), I have this Koan code. How do I read this? It looks like a variable with val
, but it is a function with a ()
and {}
.
val Customer.orderedProducts: Set<Product> get() {
// Return all products this customer has ordered
todoCollectionTask()
}