I notice that when I run this code:
var letters = ["a", "b", "c", "d", "e", "f"]
for i in letters {
print(i)
letters.removeLast()
}
it prints:
a
b
c
d
e
f
and not:
a
b
c
I'm assuming it's because when I call removeLast() it's removing from a copy of letters and not the original letters array that the for loop is using. How can I remove from the array the for loop is using?