Operators

Do math, compare values, combine booleans, and work with text and random numbers.

math_number
// A number value
0;
arithmetics_add
// Add two numbers
10 + 10;
View on MDN ↗
arithmetics_subtract
// Subtract one number from another
10 - 10;
View on MDN ↗
arithmetics_multiply
// Multiply two numbers
10 * 10;
View on MDN ↗
arithmetics_divide
// Divide one number by another
10 / 10;
View on MDN ↗
arithmetics_power
// Raise a number to a power
10 ** 10;
View on MDN ↗
arithmetics_modulo
// Get the remainder of dividing one number by another
10 % 10;
View on MDN ↗
compare_equals
// Check whether two values are equal
0 == 0;
View on MDN ↗
compare_notEquals
// Check whether two values are not equal
10 != 10;
View on MDN ↗
compare_lessThan
// Check whether one value is less than another
10 < 10;
View on MDN ↗
compare_lessThanOrEqual
// Check whether one value is less than or equal to another
10 <= 10;
View on MDN ↗
compare_greaterThan
// Check whether one value is greater than another
10 > 10;
View on MDN ↗
compare_greaterThanOrEqual
// Check whether one value is greater than or equal to another
10 >= 10;
View on MDN ↗
operation_and
// True only when both values are true
false && false;
View on MDN ↗
operation_or
// True when at least one value is true
false || false;
View on MDN ↗
not
// Invert a boolean value
!false;
View on MDN ↗
boolean
// A true or false value
true;
View on MDN ↗
math
// Apply a math function such as absolute value
Math.abs(0);
View on MDN ↗
random
// Get a random number between 0 and 1
Math.random();
View on MDN ↗
constant
// A mathematical constant such as Pi
Math.PI;
View on MDN ↗
string
// Convert a value to text
String(0);
View on MDN ↗
number
// Convert a value to a number
Number("");
View on MDN ↗
type
// A type such as number, string or boolean
any;
generic
// A generic type such as an array of a given type
Array<any>;
union
// A type that can be one of several types
number | string;