2.1. Arrays
var carMakes = [String]()var carMakesSecond = ["Toyota", "Honda"]Adding a new element to an existing array:
carMakes.append("Mazda")
// Print the current elements of the array...
print(carMakes)["Mazda"]carMakes.append("Toyota")
carMakes.append("Honda")
// Print the current elements of the array...
print("After appending: \(carMakes)")Size of an existing array:
Accessing an element from a particular position:
Removing an element from an existing array:
Last updated