Last active
September 1, 2022 13:12
-
-
Save dvt32/d0274a8c5447b1f99681e60fb321e38b 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
fun awesomeMethod(a: Int, b: Int) = a + b - 101 // No need to specify return type or use "return" keyword | |
// This can come in handy when combining it with Kotlin's expression features | |
fun totallyAmazingMethod(str: String?, a: Int) = | |
str?.uppercase() ?: | |
if (a == 5) "some string" else "some other string" | |
// Can be helpful when using functional programming... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment