Swift arrays: making one empty | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Swift arrays: making one empty

How do you make an array empty. I keep typing var xyz = [] and the compiler gives me an error when ran. It says "whitespace"

10th Dec 2018, 9:02 PM
Mason Taylor
Mason Taylor - avatar
1 Answer
0
I got it. var xyz = [String]() or for ints var xyz = [Ints]()
10th Dec 2018, 10:23 PM
Mason Taylor
Mason Taylor - avatar