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

Kursinnhold

Introduction to JavaScript (staging)

Introduction to JavaScript (staging)

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

book
Undefined

What is Undefined

Undefined is also a data type in JavaScript just like the null. When a variable is created or declared without assigning any value to it, then the value of the variable will be set as undefined by default.

12
let age; console.log(age);
copy
Oppgave

Swipe to start coding

Declare a variable numberOfItems and assign the value of undefined to the variable and show the value of the variable.

Løsning

So, undefined variables can also be declared using the undefined keyword.

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 31
toggle bottom row

book
Undefined

What is Undefined

Undefined is also a data type in JavaScript just like the null. When a variable is created or declared without assigning any value to it, then the value of the variable will be set as undefined by default.

12
let age; console.log(age);
copy
Oppgave

Swipe to start coding

Declare a variable numberOfItems and assign the value of undefined to the variable and show the value of the variable.

Løsning

So, undefined variables can also be declared using the undefined keyword.

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 31
Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Vi beklager at noe gikk galt. Hva skjedde?
some-alt