Web site domain - JavaScript Programmer’s Reference Bitwise AND then assign (&=)
JavaScript Programmer’s Reference Bitwise AND then assign (&=) (Operator/assignment) Bitwise AND two operands and assign the result to the first. Availability: ECMAScript edition 2 JavaScript 1.0 JScript 1.0 Internet Explorer 3.02 Netscape 2.0 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: Number primitive JavaScript syntax: -anOperand1 &= anOperand2 anOperand1 A binary value Argument list: anOperand2 Another binary value Bitwise AND 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; 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. The truth table shows the result of this operator for two Boolean primitive values: A B AND false false false false true false true false false true true true This is applied to each corresponding bit pair in the two values. 1 0 0 1 0 0 1 0 0 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1