Null
What is Null
The data type null
represents that there is no value. It is a primitive value in javascript.
To have a better understanding of null
, we must know these two features about null
:
null
provides the non-existent value or empty value.null
has to be assigned to a variable as it is not assigned by default (unlike theundefined
).
12let number = null; console.log(number);
Swipe to start coding
Declare a variable selectColor
and assign the value of null
to the variable and display the value of the variable.
Solution
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 2
Null
Swipe to show menu
What is Null
The data type null
represents that there is no value. It is a primitive value in javascript.
To have a better understanding of null
, we must know these two features about null
:
null
provides the non-existent value or empty value.null
has to be assigned to a variable as it is not assigned by default (unlike theundefined
).
12let number = null; console.log(number);
Swipe to start coding
Declare a variable selectColor
and assign the value of null
to the variable and display the value of the variable.
Solution
Thanks for your feedback!
Awesome!
Completion rate improved to 2single