Question: how to check both undefined and null in typescript?
Answer: JavaScript (and by extension TypeScript) has two bottom types : null and undefined . ... 
Fact is you will need to deal with both. ... 
Recommend == null to check for both undefined or null . ... 
One exception, root level undefined values which we discuss next.
Remember how I said you should use == null .