The first is to understand the operator | | This is done: starting with a meaningful return from the first, or returning the last expression (note that it is not necessarily a Boolean value); && is doing this: starting with the first one, encountering a meaningless return, or returning the last expression (note ibid.);! This is done: take the value of the expression (note not the expression). Then try to look at the following code: var ob1 = new Boolean (false), var ob2 = (ob1&&true), var ob3 = (true&&ob1), var ob4 = Boolean (o B1&&true) var ob5 = Boolean (TRUE&&OB1), alert ("OB2 =" + Ob2 + "OB3 =" + ob3 + "OB4 =" + ob4 + "OB5 = "+ ob5); The result of the last Test is OB2 = True ob3 = False Ob4 = True OB5 = True
New Boolean (), new Boolean (false) is the same thing, because it is an object, it makes sense, but its value is false, so it can be seen as "meaningful false", so the result is the value of the last expression.
The original Boolean and Boolean objects are so different from each other, so keep in mind that they are different and don't confuse use.
a boolean object ,boolean object is an encapsulation of a Boolean value.
boolean object: A Boolean object with a value of true or false.
This problem is recently in the experience of a cow-guest app to do JavaScript topics encountered, and then query the information, and then general coding process we still do not write, so write not much significance, direct use of the original Boolean value can be, so it is difficult to write again understanding , it doesn't make much sense. But it's still possible to install X occasionally!
Deep understanding of Boolean object values and original values