Operators
Fluency Programming Language follows the JavaScript / ECMAScript (ES6) syntax closely.
Arithmetic
The following tables shows the list of supported arithmetic operators:
| Name | Value | Description |
|---|---|---|
| Addition | + | |
| Subtraction | - | |
| Multiplication | * | |
| Division | / | Floating-point division |
| Modulo | % | Modulus from division |
Relational
The following tables shows the list of supported relational operators:
| Name | Value | Description |
|---|---|---|
| Equality | == | |
| Inequality | != | |
| Less-than | < | |
| Greater-than | > | |
| Less-than or equal | <= | |
| Greater-than or equal | >= |
Logical
The following tables shows the list of supported logical operators:
| Name | Value | Description |
|---|---|---|
| AND | && | |
| OR | || | |
| NOT | ! |
Bitwise
The following tables shows the list of supported bitwise operators:
| Name | Value | Description |
|---|---|---|
| AND | & | |
| OR | | | |
| XOR | ^ | |
| Right Shift | >> | |
| Left Shift | << |
Ternary
The ternary conditional operator is supported:
condition ? trueValue : falseValue
Optional chaining (?.)
The optional chaining (?.) operator accesses an object’s property or calls a function.
If the object’s property or function is undefined or null, the expression evaluates to 'undefined', instead of throwing an error.