In swift, we use the
let keyword to declare a constant variable, a constant is a variable that once declared, the value can not be changed.
We can declare a variable in swift like below:
let myAge: Int = 27
let keyword above, we use it to denote that
myAge is a constant and should hold the integer
27. Unlike variable declared using the
var keyword, we cannot change the value of a constant once it has been assigned.
A constant is very similar to a variable except it value cannot be changed when declared.
It’s important that you keep the following in mind. You can declare a constant with the
let keyword, constant have the same properties as a variable (var) which include type annotation, naming convention etc., except once a value has been assigned, the value cannot be changed