Swift 6 · Basics and optionals
Arrays and dictionaries
Collections are value types and use generic syntax.
var numbers = [3, 1, 2]
numbers.append(4)
let ages: [String: Int] = ["Ada": 36, "Grace": 45]
let age = ages["Ada"] // Int?
Official Swift 6 documentation