Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Created December 24, 2020 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatilShreyas/0cd4d2ed895afa28b1df233ecf04353d to your computer and use it in GitHub Desktop.
Save PatilShreyas/0cd4d2ed895afa28b1df233ecf04353d to your computer and use it in GitHub Desktop.
fun doSomething(person: Person?) {
if (person != null) {
// Do something with `person`
}
}
fun doSomething(person: Person?) {
person?.let { p ->
// Play with `p` safely :)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment