Last active
March 30, 2020 16:59
-
-
Save akexorcist/636136232e92cb7a70e3bddc6e7830fc to your computer and use it in GitHub Desktop.
Code Snippet for https://blacklenspub.com/inline-function-in-kotlin-adb51b0eab76
This file contains hidden or 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 startHere() { | |
| var addResult = calculate(10, 3, { x, y -> | |
| x + y | |
| }) | |
| ... | |
| } | |
| fun calculate(x: Int, | |
| y: Int, | |
| equation: (x: Int, y: Int) -> Int): Int { | |
| // Do something | |
| return equation(x, y) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment