var
Create a mutable value.
var name = expressionDefines a mutable runtime value. In an fn body, an optional :type selects the native type.
Example
var count = 0
count += 1Syntax
<name:id> [":" <type:qualified-id>] "=" <value:expr>Example
var count = 0
count += 1Arguments
- —
- : —
- name — Name of the new variable.
- type — Optional native type; inferred when omitted.
- value — Initial value. Assignment may change it later.