TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

JavaScript Boolean

JavaScript Boolean Object is primitive datatype that return two value i.e. True or false. Boolean get the value of a variable, conditions, expressions etc.

<< Back to JAVASCRIPT

JavaScript Boolean

JavaScript Boolean is an object that represents value in two states: true or false. You can create the JavaScript Boolean object by Boolean() constructor as given below.

Boolean b=new Boolean(value);

The default value of JavaScript Boolean object is false.

JavaScript Boolean Example

<script>
document.write(10<20);//true
document.write(10<5);//false
</script>

JavaScript Boolean Properties

PropertyDescription
constructorreturns the reference of Boolean function that created Boolean object.
prototypeenables you to add properties and methods in Boolean prototype.

JavaScript Boolean Methods

MethodDescription
toSource()returns the source of Boolean object as a string.
toString()converts Boolean into String.
valueOf()converts other type into Boolean.




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf