0

What is the meaning of the expression >>> in JavaScript? It is like type conversion, or what, and when it recommended to use?

I ran into that symbol (>>>) when I read this article and am a little confused.

Sorry, if my question is stupid, but I can not find any answers by Google search or other ways.

Ivar
  • 6,138
  • 12
  • 49
  • 61
Ivan B.
  • 11
  • 1
    Hi, welcome to Stack Overflow. This question has already been asked here: https://stackoverflow.com/questions/1822350/what-is-the-javascript-operator-and-how-do-you-use-it Best of luck :) – MasNotsram Sep 18 '17 at 11:08

1 Answers1

1

>>> is a bitwise operator.

>>> (Zero-fill right shift) This operator shifts the first operand the specified number of bits to the right. Excess bits shifted off to the right are discarded. Zero bits are shifted in from the left. The sign bit becomes 0, so the result is always non-negative.

For non-negative numbers, zero-fill right shift and sign-propagating right shift yield the same result. For example, 9 >>> 2 yields 2, the same as 9 >> 2

From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators

mrks
  • 5,439
  • 11
  • 52
  • 74