Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Null | Data Types and Variables
Introduction to JavaScript (staging)
course content

Course Content

Introduction to JavaScript (staging)

Introduction to JavaScript (staging)

1. Introduction
2. JavaScript syntax
3. Data Types and Variables

book
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 the undefined).
12
let number = null; console.log(number);
copy
Task
test

Swipe to show code editor

Declare a variable selectColor and assign the value of null to the variable and display the value of the variable.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 30
toggle bottom row

book
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 the undefined).
12
let number = null; console.log(number);
copy
Task
test

Swipe to show code editor

Declare a variable selectColor and assign the value of null to the variable and display the value of the variable.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 30
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt