Avatar ·

How to merge or combine arrays in Swift?

Hi! I'm new to Swift and can't figure out how to combine arrays. I have two string arrays: one with student names from the first group, and the second from the second group. I need to get a combined array of all students, then sort it and display it in a table. Here's an example of my code: ```swift let group1 = ["Anna", "Boris", "Victor"] let group2 = ["Gleb", "Daria", "Elena"] var allStudents = ??? ``` I tried using the `+` operator, but I'm not sure if that's correct. I also saw the `append(contentsOf:)` method, but it seems to modify the original array, and I need to keep the originals. I also read somewhere about `joined()`, but it returns a string, not an array. Please tell me what ways there are to combine arrays in Swift? Preferably with code examples so I can...