In addition to everything that was said before, when you are trying to use typeof null it will give you object, it`s because of old legacy bug, which is kept until this days, and typeof undefined will give you more obvious undefined. Also type casting will convert null and undefined, so == comparison will give you true between them, but not ===