Last active
May 5, 2020 08:29
-
-
Save sagarpatel288/fadbd3700b3d2ccf5db492b5f808f6d1 to your computer and use it in GitHub Desktop.
When a higher order function has only one parameter and the parameter type is function type
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
/** | |
* While calling the higher order function When the function type parameter is only parameter, | |
* we can simply write our business logic between curly braces after writing the function name | |
* and omit function call parentheses like below: | |
*/ | |
doSomething { x: Int, y: Int -> x + y } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment