Skip to content

Instantly share code, notes, and snippets.

@s1monw1
Last active September 8, 2022 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s1monw1/14679fdd2687ad04eb9312c1bff2a718 to your computer and use it in GitHub Desktop.
Save s1monw1/14679fdd2687ad04eb9312c1bff2a718 to your computer and use it in GitHub Desktop.
// 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