Web hosting unlimited bandwidth - JavaScript Programmer’s Reference Bitwise AND (&) (Operator/bitwise) Bitwise

JavaScript Programmer’s Reference Bitwise AND (&) (Operator/bitwise) Bitwise AND of two operands. ECMAScript edition 2 JavaScript 1.0 JScript 1.0 Internet Explorer 3.02 Netscape 2.0 Netscape Enterprise Server 2.0 Opera 3.0 Availability: Property/method value type: JavaScript syntax: - Argument list: anOperand1 anOperand2 Number primitive anOperand1 & anOperand2 Another binary bit pattern The result is the bitwise AND of both binary bit pattern values. A binary bit pattern This operator performs a bit by bit AND of the 32-bit value derived from both operands. Effectively, each corresponding bit pair has a logical AND applied to it. 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 Where a corresponding bit is 1 in both values, a 1 bit is inserted into the result otherwise the value is zero. The associativity is left to right. Refer to the Operator Precedence topic for details of execution order. 1 0 0 1 0 0 1 0 0 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1

Leave a Reply