Copy code code as follows:
result = [Interaction 1] & [Interal 1]
& Perform each bit of two 32 -bit expressions "and" with "operations. If both bits are 1, the result is 1. Otherwise, the result is 0.
| 1st | Position 2 | Position and |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
Copy code code as follows:
// 9 binary is 1001, and 32 -bit is 000000000000000000000000001001
var expr1 = 9;
// 5 is 000000000000000000000000000101
var expr2 = 5;
/*
0000000000000000000000001001
&
0000000000000000000000000101
=
0000000000000000000000000001
=
1
*/
var result = expr1 & expr2;
alert (result);
// Plug it [1]
expr1 & = expr2;
alert (expr1);
// Plug it [1]