var a = [1, 2, 3] // b is a separate copy (copy-on-write under the hood) var b = a b.append(4) print(a) print(b)
copying an array is independent