February 2019
Intermediate to advanced
442 pages
11h 46m
English
Kotlin allows us to pass a function to other (higher-order) functions as a parameter, using the lambda expression. Such a function can accept as a parameter a lambda expression or an anonymous function. Before discussing this topic further, let us first understand what a function type is.
Kotlin is a statically typed language and the functions also need to have a type. It is called a function type. We will see a few examples of how to define them as follows: