JavaScript Programmer’s Reference (How to cite a web site) Property/method value type: Number primitive

JavaScript Programmer’s Reference Property/method value type: Number primitive JavaScript syntax: -anOperand1 ^= anOperand2 anOperand1 A numeric value that can be assigned to Argument list: anOperand2 Another numeric value Bitwise XOR the right operand with the left operand and assign the result to the left operand. This is functionally equivalent to the expression: anOperand1 = anOperand1 ^ anOperand2; Performs a bit-by-bit XOR of the 32-bit values derived from both operands. Where a corresponding bit is different in both operands, a 1 bit will be inserted into the result. If the corresponding bit is identical in both operands, regardless of whether they both have a 1 bit or a zero bit, a zero will be inserted at that bit position in the result. Although this is classified as an assignment operator it is really a compound of an assignment and a bitwise operator. The associativity is right to left. Refer to the Operator Precedence topic for details of execution order. The new value of anOperand1is returned as a result of the expression. This is the truth table for two Boolean primitive values being operated on with the XOR operator A B XOR false false false false true true true false true true true false The bitwise operator performs this operation on each corresponding bit pair in the two operands. Warnings: . The operand to the left of the operator must be an LValue. That is, it should be able to take an assignment and store the value. See also: Assignment operator, Associativity, Bit-field, Bitwise operator, Bitwise XOR (^), LValue, Operator Precedence

Leave a Reply