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.
Solution
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 2
Boolean 2/4
Swipe to show menu
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.
Solution
Thanks for your feedback!
Awesome!
Completion rate improved to 2single