Evaluates an arithmetic conditional. The syntax is similar to JavaScript. The allowed operations are:
(...)
a + b
a / b
a * b
a - b
a % b
not b
a and b
a or b
a == b
a != b
a >= b
a > b
a <= b
a < b
a ? b : c
abs a
flooring a
round a
ceil a
random(n)
min(n, ...)
max(n, ...)
const { result } = evaluate('a + b', { a: 1, b: 2 }); console.log(result); // -> 3
{RangeError} there were missing variables needed to evaluate the conditional
{TypeError} the condition was malformed
Evaluates an arithmetic conditional. The syntax is similar to JavaScript. The allowed operations are:
(...)
a + b
a / b
a * b
a - b
a % b
not b
a and b
a or b
a == b
a != b
a >= b
a > b
a <= b
a < b
a ? b : c
abs a
flooring a
round a
ceil a
random(n)
min(n, ...)
max(n, ...)
const { result } = evaluate('a + b', { a: 1, b: 2 }); console.log(result); // -> 3
{RangeError} there were missing variables needed to evaluate the conditional
{TypeError} the condition was malformed