Skip to main content

Assignment expressions

Assignment expressions are used to assign a value to an identifier.

An assignment expression can be structured in two ways:
  • identifier = expression
  • let identifier = expression

The result is the same with both syntaxes. The let keyword can be used to make sure that the assignment expression cannot be interpreted as a comparison expression.

The value can be any of the supported data types, as well as an expression. For example:
PI = 3.1415f
let preferences.color = 'yellow'
stats.average = (data.a + data.b) / 2
LET message = concat(string.a, ' ', string.b)

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!