JavaScript triple greater than

后端 未结 4 1294
深忆病人
深忆病人 2020-11-27 15:30

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

var len = this.length >>> 0;

What does >&g

4条回答
  •  无人及你
    2020-11-27 16:16

    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.

提交回复
热议问题