// 1.声明一个带有默认值的数组 var firstNameArray = [String](count: 3, repeatedValue: "Chen")// 2.使用bool值属性判断数组是否为空 if firstNameArray.isEmpty {print(firstNameArray.isEmpty)print("The first name list is empty") } else {print(firstNameArray.isEmpty)print("The first name list is not empty") }// 3.往数组里添加元素 firstNameArray.append("Zhang") firstNameArray += ["Li"]// 4.更改数组范围里的元素 firstNameArray[0...3] = ["Luo"]// 5.插入元素到数组内 firstNameArray.insert("Hu", atIndex: firstNameArray.endIndex)