Created
April 23, 2020 12:26
-
-
Save sagarpatel288/5cbff4108cd2feacce2d090711a11ecd to your computer and use it in GitHub Desktop.
Function type as a parameter in a higher order function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun doSomething(a: Int, b: Int, ft: (Int, Int) -> Int): String { | |
val result = ft(a, b) //OR ft.invoke(a, b) | |
return “doSomething: ” + result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment