---
title: "Comment by slikts on \"20 TypeScript Interview Questions and Answers in 2018\" | Hashnode"
description: "Just checking for truthiness when you specifically mean null or undefined is an antipattern since it leads to accidentally mishandling values like 0 or empty st"
url: "https://hashnode.com/posts/20-typescript-interview-questions-and-answers-in-2018/5b61c42d266c9a352f647c7f/comment/5b621353266c9a352f647e94"
---

[Discussion](https://hashnode.com/posts/20-typescript-interview-questions-and-answers-in-2018/5b61c42d266c9a352f647c7f)

Comment [20 TypeScript Interview Questions and Answers in 2018](https://hashnode.com/posts/20-typescript-interview-questions-and-answers-in-2018/5b61c42d266c9a352f647c7f)

[slikts](https://hashnode.com/@slikts)

[Aug 1, 2018](https://hashnode.com/posts/20-typescript-interview-questions-and-answers-in-2018/5b61c42d266c9a352f647c7f/comment/5b621353266c9a352f647e94)

Just checking for truthiness when you specifically mean `null` or `undefined` is an antipattern since it leads to accidentally mishandling values like 0 or empty strings. You should use `== null` in this case instead.

[Alex Ershov](https://hashnode.com/@aershov24)

[Aug 2, 2018](https://hashnode.com/posts/20-typescript-interview-questions-and-answers-in-2018/5b61c42d266c9a352f647c7f/comment/5b621353266c9a352f647e94#reply-5b62681d9ed4e2bf786dd7ff)

Thanks for suggestion [slikts](https://hashnode.com/@slikts)! Just corrected the answer!
