-
Notifications
You must be signed in to change notification settings - Fork 23
Higher order functions
Devrath edited this page Feb 10, 2024
·
15 revisions
Definition
- Higher-order functions are the ones that take
functions
as parameters or returnfunction
as a result. - We can even store the higher-order function in a variable and a data structure.
- They enable functional programming concepts and allow you to write more concise and expressive code.
- Functions in kotlin have a type
- The same way as we can declare
Int
,String
,Person
we can declare something of type function - A type is composed of
FunctionParameters
+FunctionReturnType
(Parameters are declared within these brackets)
-->ReturnType
Contents