Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Love for TypeScript. Parent comment
fun myFunction(x: Number?) { if (x == null) return; print(x + 1); }
You can also do:
x?.let {notNullX -> print(notNullX + 1)}
print((x ?: 4) + 1)
It really is an awesome language. Especially the delegated properties are wonderful. I use them to fill javascript-state for redux/react-native.
There are no comments on this comment yet.
You can also do:
or https://kotlinlang.org/docs/reference/null-safety.htmlIt really is an awesome language. Especially the delegated properties are wonderful. I use them to fill javascript-state for redux/react-native.