I’m currently learning Arrays, and I’d like to ask why the following code does not work:
//Trying to create an empty array here:
var thisOtherArray = Array("")
print(thisOtherArray)
//Trying to append “Fifi” to the above array.
thisOtherArray += [“Fifi”]
Why doesn’t this work?
Do I have to instead write it as:
var thisOtherArray: [String] = [" "]
I assumed the first block of code would work because the following code DOES work:
var arrayOfValues = Array(10…19)
Please let me know, thank you!