Another convenient way to convert ArraySlice to Array is to:
var tags = ["this", "is", "cool"] var someTags: [String] = tags[1..<3] + []
This is not ideal, because another developer (or himself) who looks at him later may not understand his goals. The good news is that if this developer (maybe you) removes + [] they will be immediately greeted with a compiler error, which I hope will clarify its purpose.
jeremyabannister Oct. 16 '18 at 22:32 2018-10-16 22:32
source share