Expression syntax
Read the full expressions guide for step-by-step usage, examples, precedence, and troubleshooting.
| Construct | Example | Result |
|---|---|---|
| String interpolation | Score: ${private.score} |
Text with the current score |
| Number expression | ${private.score * 2} |
Number |
| Grouping | ${(2 + 3) * 4} |
20 |
| Exponentiation | ${2 ^ 3} |
8 |
| Chained powers | ${2 ^ 3 ^ 2} |
512 |
| Unary sign | ${-2 ^ 2} |
-4 |
| String join | ${'Round ' + public.round} |
Text |
| Fallback | ${save.bestScore ?? 0} |
Primary or fallback |
| Field read | ${private.stats.points} |
Accessible field value |
| Literal marker in String | \${private.score} |
Literal ${private.score} |
Scopes: private, public, save, environment; bare names use Private. Arithmetic: + - * / % ^. Fallback is lazy and does not catch arbitrary failures. Number inputs require one complete expression yielding a non-null Number.
Names must already be declared. Supported identifiers use letters, digits, _, and $, with no initial digit. Names containing spaces need Variable items instead of expression identifiers. Null prints as null; unassigned reads need initialization or fallback.
No comparison/Boolean operators, collection indexing, method calls, or host APIs are supported inside expressions. Use visual operations and conditions for those capabilities.
Use ^ for exponentiation. The former ** operator is no longer accepted.