Skip to content

Instantly share code, notes, and snippets.

@s1monw1
Last active Sep 8, 2022
Embed
What would you like to do?
// A function `higherOrderFunction` taking another function `functionAsArgument` as its argument.
// The function calls the passed in function passing the value `5` to it. The result of `functionAsArgument(5)`
// is returned back to the caller.
fun higherOrderFunction(functionAsArgument: (Int) -> String) =
functionAsArgument(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment