-
-
Save codeforfun-jp/1ebadbb6811ed64352870a2270d405c4 to your computer and use it in GitHub Desktop.
[Kotlin Intro] Function Types & Lambda 1-6
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
fun main() { | |
val userProfile: (Int, Boolean) -> String = { coin, isLoggedIn -> | |
val status = if (isLoggedIn) "Online" else "Offline" | |
"Coin: $coin, Status: $status" | |
} | |
println(userProfile(25, false)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment