Basics

Comments, variables, values, strings, and the operators you will use every day.

Comments

Three ways to leave notes in a tag. Comments are skipped by the parser.

rune
3 lines

Variables

Declare with let, const, or var. You can also skip the keyword and let Rune infer the variable. The assignment operators behave as expected.

rune
6 lines

Values

Rune has the usual value types: numbers, strings, booleans, null, undefined, arrays, and dictionaries.

rune
9 lines

Read any key on a dictionary or index into an array with dot notation or square brackets. Numbers work as dot keys too.

rune
5 lines

Strings and interpolation

Use single or double quotes. Inside a string, [name] is replaced with the value of the variable name. The path can be as deep as you like.

rune
11 lines

Write \[ for a literal opening bracket, and reach for backtick strings when you prefer ${...} syntax.

rune
1 line

Operators

Arithmetic, comparison, logic, membership, and more are all built in.

rune
20 lines

== and != compare loosely: null and undefined count as equal, and numbers and booleans coerce. So "5" == 5 is true. To check whether an argument or lookup is missing, compare against null.

rune
3 lines