Join Slack
Powered by
`b?.let { a?.plus(it) ?: it } ?: a` to return null...
# announcements
e
elizarov
12/06/2017, 7:29 PM
b?.let { a?.plus(it) ?: it } ?: a
to return null only if both are null
c
Czar
12/06/2017, 7:30 PM
this works, but it's really unreadable, in production code at least extract this to appropriately named method.
➕ 1
e
elizarov
12/06/2017, 7:40 PM
Absolutely. A separate method if you are going to use it in real code
2
Views
Open in Slack
Previous
Next