Skip to content
Justice Tech School

let and var

let makes a constant and var a variable. Swift infers types and checks them strictly.

Example
let name = "Ada"
var age = 30
age += 1
print("\(name) is \(age)")

Exercise

Constant keyword.

 pi = 3.14

Quiz Test

Can a let change?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.