Operators

Operators are single or double characters that represent simplified versions of their function alternatives.

Operators are mostly for mathematical calculations or comparing two values. The + operator can also be used to concatenate strings!

Operators Quick Reference

+

Adds two values together.

Accepts
Returns
Syntax
value + value
Function

add

Learn more about + →


-

Subtracts two numbers.

Accepts
Returns
Syntax
number - number
Function

subtract

Learn more about - →


*

Multiplies two numbers.

Accepts
Returns
Syntax
number * number
Function

multiply

Learn more about * →


%

Returns the remainder of the first number divided by the second.

Accepts
Returns
Syntax
number % number
Function

mod

Learn more about % →


^

Returns the result of a base number raised to an exponent power.

Accepts
Returns
Syntax
number ^ number
Function

pow

Learn more about ^ →


/

Divides two numbers.

Accepts
Returns
Syntax
number / number
Function

divide

Learn more about / →


==

Checks if two values are equal.

Accepts
Returns
Syntax
value == value
Function

equal

Learn more about == →


!=

Checks if two values are not equal.

Accepts
Returns
Syntax
value != value
Function

unequal

Learn more about != →


>

Checks if the first value is greater than the second.

Returns
Syntax
value > value

Learn more about > →


>=

Checks if the first value is greater than or equal to the second.

Returns
Syntax
value >= value

Learn more about >= →


<

Checks if the first value is less than the second.

Returns
Syntax
value < value

Learn more about < →


<=

Checks if the first value is less than or equal to the second.

Returns
Syntax
value <= value

Learn more about <= →


&& · and

The boolean operator and.

Accepts
Returns
Syntax
boolean && boolean
Function

and

Learn more about && · and →


|| · or

The boolean operator or.

Accepts
Returns
Syntax
boolean || boolean
Function

or

Learn more about || · or →


! · not

Returns the opposite of a boolean value.

Accepts
Returns
Syntax
!boolean
Function

not

Learn more about ! · not →


? :

The ternary operator.

Accepts
Returns
Syntax
boolean ? expression : result
Function

if

Learn more about ? : →