to create the syntax for a Boolean object:
New Boolean (value); //constructor
& nbsp; Boolean (value); //conversion function
parameter value The value held by a Boolean object or the value to convert to a Boolean value.
return value
when invoked as a constructor (with operator new), Boolean () converts its arguments to a Boolean value. and returns a Boolean object that contains the value.
if invoked as a function (without operator new), Boolean () converts its arguments to an original Boolean value and returns the value.
Note: If the value argument is omitted, or set to 0,-0, NULL, "", false, undefined, or NaN, the object is set to False. Otherwise set to true (even if the value parameter is the string "false").
var falseobject = new Boolean (false);
var result = Falseobject && true;
alert (result); True
var falsevalue = false;
result = Falsevalue && true;
alert (result); False
alert (typeof falseobject);//object
alert (typeof falsevalue);//boolean
alert (falseobject Instanceof Boolean); True
alert (falsevalue instanceof Boolean);//false
Boolean Object Description
In JavaScript, a Boolean value is a basic type of data. A Boolean object is a Boolean object that packs a Boolean value. A Boolean object is primarily used to provide a toString () method that converts a Boolean value to a string.
When the ToString () method is invoked to convert a Boolean value to a string (usually by JavaScript implicitly), JavaScript converts the Boolean value internally to a temporary Boolean object, and then invokes the object's ToString () method.
The above is today's JavaScript learning Summary, and will continue to update every day, I hope you continue to pay attention.