JavaScript Bitwise Unsigned Right Shift Operator



Bitwise Unsigned Right Shift Operator

>>> symbol is used for Bitwise Unsigned Right Shift operator.

Bitwise Unsigned Right Shift operator takes two values/variables as operands, shifts the bits of left operand (all bits are data bits, no sign bits) in the right side direction by the number of positions given by right operand in right, and returns their result.

a >>> b
52 >>> 3

Examples

1. Right shift a by b number of bits.

a = 52;
b = 3;
output = a >>> b;
console.log(`${a} >>> ${b} = ${output}`);

1. Right shift a by b number of bits, when a is negative.

a = -52;
b = 3;
output = a >>> b;
console.log(`${a} >>> ${b} = ${output}`);