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

原创
ithorizon 5个月前 (10-19) 阅读数 40 #HTML

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

示例

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

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

以上就是JavaScript位右移(>>)运算符是什么?的详细内容,更多请关注IT视界其它相关文章!



热门