Skip to content

Commit e1f2c1c

Browse files
committed
Modified the example to demonstrate 'sumBy'
1 parent f9e6067 commit e1f2c1c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ii_collections/n19Sum.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package ii_collections
22

33
fun example6() {
4-
val sum = listOf(1, 5, 3).sum()
4+
listOf(1, 3).sum() == 4
5+
listOf("a", "b", "cc").sumBy { it.length } == 4
56
}
67

78
fun Customer.getTotalOrderPrice(): Double {

0 commit comments

Comments
 (0)