January 2017
Intermediate to advanced
420 pages
9h 25m
English
In the previous chapter, we introduced Kotlin's support for functions and the various features we can use while writing functions. In this chapter, we continue on that theme by discussing higher order functions and how we can use them to write cleaner and more expressive code.
In this chapter, we will cover:
A higher order function is simply a function that either accepts another function as a parameter, returns a function as its return value, or both.
Let's consider the first example:
fun foo(str: String, fn: (String) -> String): Unit { val applied = fn(str) ...Read now
Unlock full access