Boolean 2/4
Boolean Data Type
We use the typeof operator to check the data type of variables, for example.
1234let isRaining = true; console.log(typeof isRaining); // or like this console.log(typeof(isRaining));
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.
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.
Ratkaisu
Kiitos palautteestasi!
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
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?
Mahtavaa!
Completion arvosana parantunut arvoon 2
Boolean 2/4
Pyyhkäise näyttääksesi valikon
Boolean Data Type
We use the typeof operator to check the data type of variables, for example.
1234let isRaining = true; console.log(typeof isRaining); // or like this console.log(typeof(isRaining));
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.
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.
Ratkaisu
Kiitos palautteestasi!
single