| Category | Operators |
|---|---|
| Arithmetic | + - * / % ++ -- |
| Logical | && || ^ ! |
| Binary | & | ^ ~ << >> |
| Comparison | == != < > <= >= |
| Assignment | = += -= *= /= %= &= |= ^= <<= >>= |
| String concatenation | + |
| Type conversion | is as typeof |
| Other | . [] () ?: new |
| Precedence | Operators |
|---|---|
| Highest | () |
++ -- (postfix) new typeof |
|
++ -- (prefix) + - (unary) ! ~ |
|
* / % |
|
+ - |
|
<< >> |
|
< > <= >= is as |
|
== != |
|
& |
|
&& |
|
|| |
|
?: |
|
| Lowest | = *= /= %= += -= <<= >>= &= ^= |= |
| Operation | || |
|| |
|| |
|| |
&& |
&& |
&& |
&& |
^ |
^ |
^ |
^ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Operand1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| Operand2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| Result | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 |
| Operation | | |
| |
| |
| |
& |
& |
& |
& |
^ |
^ |
^ |
^ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Operand1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| Operand2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| Result | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 |