Last active
March 6, 2020 08:32
-
-
Save NitinPraksash9911/02800b8aeef56133905af27afffbf7eb to your computer and use it in GitHub Desktop.
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
/** Higher Order Function **/ | |
fun returnAfunc(a:Int):(Int)->Int{ | |
return {x:Int->x*a} | |
} | |
/** calling above HOF **/ | |
val func = returnAfunc(3) | |
val value = func(2) | |
println("value is $value") // value is 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment