JavaScript中所有二进制运算符的列表

JavaScript中所有二进制运算符的列表

本文介绍了JavaScript中所有二进制运算符的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我试图了解JavaScript中的二元运算符(仅二元运算符)可能实现的功能.到目前为止,我发现的二进制运算符的列表如下.它们主要来自此列表,但是缺少吗?

I am trying to understand what is possible with binary operators (only binary operators) in JavaScript. So far the list of binary operators I have discovered are the the following. They are primarily sourced from this list, but are any missing?

请注意,我只关注 binary 运算符,根据上面列出的来源,这些运算符定义为您用于两个对象的二进制运算符(这是正确的吗?).我还添加了@zessx的其他内容.

Note, I am after specifically only binary operators which, according to the source listed above, is defined as binary operators you use with two objects (is this accurate?). I have also added the additions from @zessx.

+   //Add
-   //Subtract
/   //Divided by
*   //Multiple
%   //Modulus
<   //Less than
>   //Greater than
&   //AND
|   //OR
^   //XOR
~   //Invert each bits
<<  //Move all bits onto the left
>>  //Move all bits onto the right
>>> //Move all bits onto the right and fill left end with 0

推荐答案

您将在规范.由于大多数常规"运算符都是二进制的(请参阅Wikipedia上的定义),因此它们不是明确的像这样列出(如一元和三元运算符).他们是:

You will find a complete list in the specification, in the expression chapter. Because the most "normal" operators are binary (see the definition at Wikipedia), they are not explicitly listed as such (like the unary and ternary operators). They are:

  • 乘法运算符
    • *运算符
    • /运算符
    • %运算符
    • Multiplicative Operators
      • The * Operator
      • The / Operator
      • The % Operator
      • 加法运算符(+)
      • 减法运算符(-)
      • The Addition operator (+)
      • The Subtraction Operator (-)
      • 左移运算符(<<)
      • 签名右移运算符(>>)
      • 无符号右移运算符(>>>)
      • The Left Shift Operator (<<)
      • The Signed Right Shift Operator (>>)
      • The Unsigned Right Shift Operator (>>>)
      • 小于运算符(<)
      • 大于运算符(>)
      • 小于等于运算符(<=)
      • 大于等于运算符(>=)
      • instanceof运算符
      • in运算符
      • The Less-than Operator (<)
      • The Greater-than Operator (>)
      • The Less-than-or-equal Operator (<=)
      • The Greater-than-or-equal Operator (>=)
      • The instanceof operator
      • The in operator
      • 等于运算符(==)
      • 不等于运算符(!=)
      • 严格等于运算符(===)
      • 严格不等于运算符(!==)
      • The Equals Operator (==)
      • The Does-not-equals Operator (!=)
      • The Strict Equals Operator (===)
      • The Strict Does-not-equal Operator (!==)

      从技术上讲,赋值和逗号运算符也是二进制的.

      Technically speaking, also the assignment and comma operators are binary.

      这篇关于JavaScript中所有二进制运算符的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

      1403页,肝出来的..

09-06 08:07