Created
December 8, 2020 23:38
-
-
Save paulocoutinhox/0d379efc41d409bfa9829bc2042f453d 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 test1(callback: (() -> Unit)? = null) { | |
callback?.let { | |
it() | |
} | |
} | |
fun test2(callback: () -> Unit?) { | |
callback() | |
} | |
fun main() { | |
println(test1()) | |
println(test2({ | |
})) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment