Sets the result of a bitwise AND operation on the value of a variable and the value of an expression. The variable and the expression are treated as 32-bit integers.
Syntaxresult &= expression
Using this operator is the same as specifying result = result & expression
The Bitwise AND Operator (&) looks at the binary representation of the values of result and expression and does a bitwise AND operation on them. The output of this operation behaves such that any time both of the expressions have a 1 in a digit, the result has a 1 in that digit; otherwise, the result has a 0 in that digit.
var expr1 = 9;
var expr2 = 5;
expr1 &= expr2;
document.write(expr1);
See also Other articles
Attributions
Microsoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4