JavaScript Programmer’s Reference Cross-references: ECMA 262 edition 2 (Free web space)
JavaScript Programmer’s Reference Cross-references: ECMA 262 edition 2 section 11.10 ECMA 262 edition 3 section 11.10 Binary logical operator (Definition) An operator that works with Boolean trueor false values. Availability: Property/method value type: ECMAScript edition 2 Boolean primitive Binary logical operators test a pair of Boolean values according to logical rules. If necessary, JavaScript will convert the operands that are passed to the expression into Boolean values before testing them. You should consult the toBooleanrules for each type of object being passed to ensure that values are cast in a way that you expect. The resulting value of a binary logical expression may be coerced to another data type on return. There is no logical XOR operator. It can be simulated though by testing two Boolean values for inequality, since that is going to occur when either is one and the other is zero; the inequality will not test true if both are one or both are zero. Warnings: . This is not to be confused with the bitwise operators, which yield a 32-bit integer value instead of the Boolean value yielded by a logical expression. See also: Logical AND (&&), Logical operator, Logical OR (||) Cross-references: ECMA 262 edition 2 section 11.11 ECMA 262 edition 3 section 11.11