Thursday, June 28, 2012

Java Script Tutorial 23 : JavaScript Boolean Object


The JavaScript Boolean object represents two values, "true" or/and "false". We can create a Boolean object in javascript as follows :


var myBooleanObj=new Boolean();


Javascript boolean object will set to false, if we do not set its initial value or has one of the following values:


0
-0
null
""
false
undefined
NaN


It will be true for any other value.

No comments:

Post a Comment