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

Svep för att visa menyn

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.

Uppgift

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 desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 16

Fråga AI

expand
ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

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.

Uppgift

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 desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 16
Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Vi beklagar att något gick fel. Vad hände?
some-alt