Jey Balachandran Jey Balachandran - 4 days ago 5
Javascript Question

JavaScript triple greater than

I saw this syntax on another StackOverflow post and was curious as to what it does:

var len = this.length >>> 0;


What does
>>>
imply?

Joe Joe
Answer

That's an unsigned right shift operator. Interestingly, it is the only bitwise operator that is unsigned in JavaScript.

The >>> operator shifts the bits of expression1 right by the number of bits specified in expression2. Zeroes are filled in from the left. Digits shifted off the right are discarded.

Comments