我想了解JavaScript中的二元运算符(只有二元运算符)可能会发生什么。到目前为止,我发现的二元运算符列表如下。他们主要来源于this list,但是缺失?JavaScript中所有二元运算符的列表
注意,我特别是后二进制运算符,根据上面列出的来源,被定义为二元运算符您使用两个对象(这是否准确?)。我还添加了@samsamX的新增内容。
+ //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
还有一些二进制运算符,比如'|' (或)和'&'为和。 –
google上的第一个结果:http://web.eecs.umich.edu/~bartlett/jsops.html – devundef
这似乎是所有运营商的视频指南:http://bateru.com/news/2011/03/ javascript-binary-operations-the-easy-way/ – devundef