Variables
In vapour you need to declare your variables before you can use them There are two ways to declare variables.
Let
Mutable variables are declared with the let
keyword.
- Vapour
- R
let x: int = 1
x = 1
Mutable variables can be declared without assigning a value to them.
- Vapour
- R
let x: int # no value assigned
x = 1
x = 1
Const
Immutable variables are declared with the const
keyword.
info
Note that there are no constants in R (perhaps with lockBinding
),
this is only checked in Vapour.
- Vapour
- R
const x: int = 1
x = 1