What is Boolean in JavaScript | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is Boolean in JavaScript

14th Dec 2021, 9:29 AM
Jelvin James
Jelvin James - avatar
3 Answers
+ 2
Boolean is a type of variable. It's values are either true or false. Example- var isOnline = true; var x = false;
14th Dec 2021, 9:32 AM
purveshKolhe
purveshKolhe - avatar
+ 1
It is a logical data type that has 'True' or 'False' as values
14th Dec 2021, 11:32 AM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
0
This is data type, mostly used to make some switch(to turn on and off something) And to check some condition, like in if/else, js can convert other data types like numbers, strings to boolean values, you will learn more about it in course.
14th Dec 2021, 10:32 AM
PanicS
PanicS - avatar