-
Book Overview & Buying
-
Table Of Contents
Android Programming for Beginners - Fourth Edition
By :
We learned why lambdas are helpful because they make our code more readable and succinct. Lambdas provide the flexibility to define code in one function and execute it in another, while still retaining access to the scope of the function where the lambda is defined.
We have looked at multiple examples to get our heads around the syntax of lambdas and learned that when a lambda has just one parameter, and we don't name it ourselves, we can refer to the parameter as it. We concluded the chapter by looking at nesting lambdas.
There is much more we can do with lambdas, but we now have the basic syntax under our belts and are ready to move on. We will see more lambda-related examples, including receivers and the this keyword, chaining lambdas, and especially lots of examples using lambdas with Kotlin's scope functions and collection functions in Chapter 15.
In the next chapter, we will cover a relatively simple but still vital topic of nullability.