Array
append(_:) vs append(contentsOf:) append : 하나의 element를 배열 맨 뒤에 추가해준다 var numbers = [1, 2, 3, 4, 5] numbers.append(100) print(numbers) // Prints "[1, 2, 3, 4, 5, 100]" append(contentsOf): 여러개의 elements를 배열 맨 뒤에 추가 해준다. var numbers = [1, 2, 3, 4, 5] numbers.append(contentsOf: 10...15) print(numbers) // Prints "[1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15]" 출처 : https://developer.apple.com/documentation..
2022. 12. 21.