Complete the code to perform a bitwise AND operation between a and b.
const result = a [1] b;The bitwise AND operator & compares each bit of two numbers and returns 1 only if both bits are 1.
Complete the code to perform a bitwise OR operation between x and y.
const combined = x [1] y;The bitwise OR operator | compares each bit of two numbers and returns 1 if at least one bit is 1.
Fix the error in the code to perform a bitwise XOR operation between num1 and num2.
const xorResult = num1 [1] num2;The bitwise XOR operator ^ returns 1 only when the bits are different.
Fill both blanks to perform a left shift of 3 bits on value and then a bitwise NOT on the result.
const shifted = (~(value [1] 3));
Left shift operator << moves bits to the left, multiplying by 2 for each shift. The bitwise NOT operator ~ flips all bits.
Fill all three blanks to perform a right shift of 2 bits on num, then bitwise AND with mask, and finally bitwise OR with flag.
const result = ((num [1] 2) [2] mask) [3] flag;
Right shift operator >> moves bits to the right. Bitwise AND & filters bits, and bitwise OR | sets bits.
