Variables
There are 2 types of variables in Cadence:
- var - can be changed
- let - a constant
cadence
var num1: Int = 0
let num2: Int = 0
num1 = 1 // good
/*
ERROR: not allowed to change a constant
self.num2 = 2
*/
There are 2 types of variables in Cadence:
var num1: Int = 0
let num2: Int = 0
num1 = 1 // good
/*
ERROR: not allowed to change a constant
self.num2 = 2
*/