So far we have used variables with the keyword var
. This is because we expect to change their value at some point.
However, if our variable is never going to change, we can declare it with the keyword let
, which makes our code a bit more efficient.
let name: String = "Pablo"
let age: Int = 35
Constants are declared without the
@State
tag. We will explain why in upcoming articles.
Be the first to comment