Skip to main content

Expressions & Operators

Aura provides a comprehensive set of operators for performing arithmetic, comparisons, logical operations, and more.

Arithmetic Operators​

Aura supports standard arithmetic operations:

OperatorNameExampleResult
+Addition5 + 38
-Subtraction10 - 46
*Multiplication2 * 36
/Division15 / 35
%Remainder10 % 31

Comparison Operators​

Comparison operators evaluate to a boolean (true or false):

OperatorDescriptionExample
==Equal to5 == 5
!=Not equal to5 != 3
<Less than2 < 10
<=Less than or equal to5 <= 5
>Greater than10 > 2
>=Greater than or equal to10 >= 10

Logical Operators​

Logical operators are used to determine logic between variables or values:

OperatorNameExample
&&ANDtrue && false
``
!NOT!true

Bitwise Operators​

For low-level data manipulation, Aura provides bitwise operators:

OperatorName
&AND
``
^XOR
~NOT (Unary)
<<SHL (Left)
>>SHR (Right)

Literal Expressions​

Aura supports several types of literal notation:

  • Template Literals: Using backticks to embed expressions: `Value: ${expr}`.
  • Array Literals: Using square brackets: [1, 2, 3].
  • Null Literal: Explicit absence of value: null.

Postfix Operators​

  • Member Access: obj.member
  • Index Access: arr[index]
  • Function Call: func(args)