Home >Web Front-end >JS Tutorial >JavaScript unsigned right shift assignment operation_Basic knowledge
Example code:
result >>>= expression
where the parameter is any variable of result.
expression is any expression.
Instructions for unsigned right shift assignment in JavaScript
Using the >>>= operator is equivalent to using the following statement:
result = result >>> expression
>>>= operator shifts all bits of result to the right by the number of digits specified by expression. After the right shift, the vacated bits on the left are filled with zeros. Bits shifted out to the right are discarded. For example:
var temp
temp = -14
temp >>>= 2
The value of variable temp is -14 (i.e. binary 11111111 11111111 11111111 11110010), shift two to the right bits equals 1073741820 (that is, binary 00111111 11111111 11111111 11111100).