What is the difference between undefined value and null value

What is the difference between undefined value and null value

1 Like

They both are the primitive data type, but the typeof of both is object.
and undefined means nothing is defined their and null means no value is declared

undefined value means we are not declaring any value to the variable whereas null value means we are declaring the value as null type.

1 Like

undefined is when a variable has not been assigned a value.
null which is represents the null, empty, or non-existent reference