Category "null-check"

kotlin inverse boolean safe casting

Let's say I have an object Response. Now I would like to check a boolean variable, success, under Response and do an early return is response is not successful.

Is there a way to check for both `null` and `undefined`?

Since TypeScript is strongly-typed, simply using if () {} to check for null and undefined doesn't sound right. Does TypeScript have any dedicated function or