minor tweak to docs
This commit is contained in:
@@ -85,7 +85,7 @@ inline fun <T> java.lang.Iterable<T>.foreach(operation: (element: T) -> Unit) {
|
|||||||
* Folds all the values from from left to right using the initial value to perform the operation on sequential pairs of values
|
* Folds all the values from from left to right using the initial value to perform the operation on sequential pairs of values
|
||||||
*
|
*
|
||||||
* For example to sum together all numeric values in a collection of numbers it would be
|
* For example to sum together all numeric values in a collection of numbers it would be
|
||||||
* {code}numbers.fold(0){(a, b) -> a + b}{code}
|
* {code}val total = numbers.fold(0){(a, b) -> a + b}{code}
|
||||||
*/
|
*/
|
||||||
inline fun <T> java.lang.Iterable<T>.fold(initial: T, operation: (it: T, it2: T) -> T): T {
|
inline fun <T> java.lang.Iterable<T>.fold(initial: T, operation: (it: T, it2: T) -> T): T {
|
||||||
var answer = initial
|
var answer = initial
|
||||||
|
|||||||
Reference in New Issue
Block a user