Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Boolean 2/4 | Data Types and Variables
Introduction to JavaScript

Sveip for å vise menyen

book
Boolean 2/4

Boolean Data Type

We use the typeof operator to check the data type of variables, for example.

1234
let isRaining = true; console.log(typeof isRaining); // or like this console.log(typeof(isRaining));
copy

As you can see in the above code we declared a variable named isRaining with the value of true, and its data type is boolean as expected.

Oppgave

Swipe to start coding

Declare a variable with the name isSunRises and set its value as true. Then check the type of isSunRises by using typeof() and display the output.

Løsning

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 16

Spør AI

expand
ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

book
Boolean 2/4

Boolean Data Type

We use the typeof operator to check the data type of variables, for example.

1234
let isRaining = true; console.log(typeof isRaining); // or like this console.log(typeof(isRaining));
copy

As you can see in the above code we declared a variable named isRaining with the value of true, and its data type is boolean as expected.

Oppgave

Swipe to start coding

Declare a variable with the name isSunRises and set its value as true. Then check the type of isSunRises by using typeof() and display the output.

Løsning

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 16
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