首页  >  文章  >  web前端  >  JavaScript位右移(>>)运算符是什么?

JavaScript位右移(>>)运算符是什么?

王林
王林转载
2023-09-02 08:17:03792浏览

JavaScript位右移(>>)运算符是什么?

使用位右移操作符,将位从左边移动。最右边的位不被考虑。

示例

您可以尝试运行以下代码,了解如何使用JavaScript位右移操作符。

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

以上是JavaScript位右移(>>)运算符是什么?的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文转载于:tutorialspoint.com。如有侵权,请联系admin@php.cn删除