JS Basic
JS Objects
JS Advanced
| JS Boolean |
Create a Boolean ObjectThe Boolean object represents two values: "true" or "false". The following code creates a Boolean object called myBoolean:
Note: If the Boolean object has no initial value or if it is 0, -0, null, "", false, undefined, or NaN, the object is set to false. Otherwise it is true (even with the string "false")! All the following lines of code create Boolean objects with an initial value of false:
And all the following lines of code create Boolean objects with an initial value of true: var myBoolean=new Boolean(true); |
JS Boolean