Values & References4 / 16
Up next

Arrays are value types

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)
What you're solving

copying an array is independent