Home  >  Article  >  Web Front-end  >  What is the JavaScript bit-right shift (>>) operator?

What is the JavaScript bit-right shift (>>) operator?

王林
王林forward
2023-09-02 08:17:03792browse

What is the JavaScript bit-right shift (>>) operator?

Use the bit right shift operator to move bits from the left. The rightmost bit is not considered.

Example

You can try running the following code to learn how to use the JavaScript bit-right shift operator.

<!DOCTYPE html>
<html>
   <body>
      <script>
         document.write("Bitwise Right Shift Operator<br>");
         document.write(-7>>1);
      </script>
   </body>
</html>

The above is the detailed content of What is the JavaScript bit-right shift (>>) operator?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete