H I O X INDIA
Javascript Tutorial
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java-Script Tutorial
Introduction
Variables
Operators
Statements
Loops
Functions
Objects
Arrays
Browser Objects
Form DOM
Ask Your Doubts
Feedback





Boolean Type & Values


Topic

Using boolean variable (true or false) in javascript?



Explanation

Boolean Data Type- E.g: true
It can have logical values true or false.
Variable type Boolean should not have any quotes.

i.e. "true" is not equal to true, "true" will be considered as a string.

var a = true;
var b = false;

Boolean variable values are mostly used along with "if", "if else" statements and "while" loops.
Example Code:
<script language="javascript">
var a = true;
if(a == true)
{
document.write("this is true");
}
</script>


Result:
this is true


        Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

others

privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com

Other Links