YASL Operators have the following precedence (from tightest bound to loosest):
Precedence | Operators | Description | Associativity |
---|---|---|---|
1 | () [] . -> |
Function Calls Indexing Member Access Method Call |
Left |
2 | ** | Exponentiation | Right |
3 | + - len ! ^ |
Unary Plus Unary Minus Length Logical Negation Bitwise Negation |
Right |
4 | * / // % |
Multiplication Float Division Integer Division Modulus |
Left |
5 | + - |
Addition Subtraction |
Left |
6 | << >> |
Bitshift Left Bitshift Right |
Left |
7 | & &^ |
Bitwise And Bitwise And-Not |
Left |
8 | ^ | Bitwise Xor | Left |
9 | | | Bitwise Or | Left |
10 | ~ | Concatenation | Right |
11 | < <= > >= |
Comparison Operators | Left |
12 | == != === !== |
Comparison Operators | Left |
13 | && | Logical And | Right |
14 | || | Logical Or | Right |
15 | ?? | Undef Coalescing Operator | Right |
16 | ? : | Ternary Operator | Right |
17 | = **= *= /= //= %= += -= >>= <<= ~= &= &^= ^= |= &&= ||= ??= |
Assignment | Right |