JavaScript Boolean

 15 - Oct - 2021
 XpertPhp
 27

A JavaScript Boolean represents a logical entity, true or false. You can create Boolean object constructors.

Syntax

var object_name  = new Boolean(value);

Example

var a = new Boolean(true);

alert(a); // true

var YES = true;

if(YES)
{
    document.write("This condition is true");
}