Variables
Variables with var and constants with let; type annotation and value reassignment.
Simple enough for a 5-year-old to understand
var and let
var is a variable whose value can change, while let is an immutable constant. Its type is inferred from the value.
var name = "Alex"let birthYear = 1815name = "Alex L."print(name)print(birthYear)🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)