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

bookBoolean 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.

Taak

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.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 16
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Suggested prompts:

What other data types can I check with the typeof operator?

Can you explain more about the boolean data type?

How does typeof work with other values like numbers or strings?

close

bookBoolean 2/4

Veeg om het menu te tonen

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.

Taak

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.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 16
single

single

some-alt