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

asked11 years ago
last updated6 years ago
viewed1m times
Up Vote655Down Vote

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 syntax sugar for this?