JavaScript » Bitwise » >>

This is the sign-propagating right shift operator which shifts the digits of the binary representation of the first operand to the right by the number of places specified by the second operand, discarding any shifted off to the right.

The copies of the leftmost bit are added on from the left, thereby preserving the sign of the number.
Note that if 'a' were -13 in the above example, the code would return -4 as the sign is preserved.


result = a >> b;

This example returns 3 (11) as the two right-most bit of 13 (1101) are shifted off to the right and discarded.