var firstArray = [1,2,3,4,5,6]
var secondArray = [1,2,3,7,8,9,0]
for item in secondArray {
// some thing that i can avoid duplicate
firstArray.append(item)
}
print(firstArray)
//end result should be firstArray = [1,2,3,4,5,6,7,8,9,0]
我想防止firstArray追加重复项
将此扩展用于独特的元素:
用法:
要保留订单,您可以这样操作: