javascript - `>>>` 在 JavaScript 中意味着什么?

标签 javascript operators bitwise-operators

>>> 的含义是什么?在 JavaScript 中?它就像类型转换,或者什么,什么时候建议使用?

当我读 this article 时,我遇到了那个符号( >>> )我有点困惑。

抱歉,如果我的问题很愚蠢,但我无法通过 Google 搜索或其他方式找到任何答案。

最佳答案

>>> 是一个按位运算符

>>> (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

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

关于javascript - `>>>` 在 JavaScript 中意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46277823/

相关文章:

C中的括号可以改变按位运算的操作数的结果类型吗?

将字节的位转换为单个位并返回

Java:负数右移

javascript - 如何在 Javascript 中将带有 3 个字母时区缩写的日期转换为 UTC?

javascript - 在 Javascript 中使用 Fetch API 上传文件并显示进度

Javascript 不会验证。 jslint : Unexpected ']'

javascript - 使用下拉框更改运算符来操作输入框

javascript - THREE.js 中自定义网格的变形目标动画

c# - ? : Operator Vs. If语句性能

java - 高优先级运算符不会在 while 条件表达式中首先被评估