# Null and '' difference

**URL:** <https://discourse.mozilla.org/t/null-and-difference/64623>\
**Category:** Learn\
**Created:** [July 27, 2020, 5:36am UTC](https://discourse.mozilla.org/t/null-and-difference/64623 "2020-07-27T05:36:59Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Harshit\_Badolla](https://avatars.discourse-cdn.com/v4/letter/h/4af34b/32.png) [@Harshit\_Badolla](https://discourse.mozilla.org/u/Harshit_Badolla)\
**Post date:** [July 27, 2020, 5:37am UTC](https://discourse.mozilla.org/t/null-and-difference/64623/1 "2020-07-27T05:37:00Z")

</div>

Hi,

I wanted to know what is the difference the following line of code  
let a = ‘’;  
let b = null;

I know the typeof operator returns string for ‘a’ and object for ‘b’ but i have seen code where it is written like while asking for input from the user and sort

if(a === ‘’ && b === null) {}

can someone give an example and explain this please. Thanks.

---

_[View the full topic](https://discourse.mozilla.org/t/null-and-difference/64623)._
