> 0" mean? What does somevar >> 0javascript mean ? thank +4 javascript operators albanx Dec 14 '10 at 8:2...">

What does "somevar >> 0" mean?


What does somevar >> 0javascript mean ?

thank

+4
source share
3 answers

B a >> b, >>is a bitwise operator that shifts bits ain the binary representation b(<32) to the right, discarding bits shifted. Link: https://developer.mozilla.org/en/JavaScript/Reference/Operators/Bitwise_Operators

+7
source

Bit shift to the right . Although somevar >> 0it looks strange.

+3
source

This is a bitwise operator. In this case, to offset the first operand in binary representation, the number of bits to the right specified in the second operand, the discarding of the bits is shifted.

With 0as the second operand, I think it has no effect (offset 0 bits, get the same value?).

I made a mistake with this last one. As explained in this comment by @Gumbo .

+1
source

All Articles