Skip to content
RED SAG Skills
hardStudy question · answer published in Swift interview questions, so no pointsswiftvalue-typesperformance

When a Swift array is copied

When is the array storage actually copied, and what does this code print?

var a = [1, 2, 3]
var b = a      // (1)
b.append(4)    // (2)
print(a.count, b.count)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions