Skip to content

Commit

Permalink
Modified the example to demonstrate 'sumBy'
Browse files Browse the repository at this point in the history
  • Loading branch information
svtk committed Aug 17, 2017
1 parent f9e6067 commit e1f2c1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ii_collections/n19Sum.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package ii_collections

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

fun Customer.getTotalOrderPrice(): Double {
Expand Down

0 comments on commit e1f2c1c

Please sign in to comment.